julia - 在 Julia 中绘制函数

标签 julia plots.jl

我想绘制以下 p-V 图的数学模型

enter image description here

但是,当我尝试绘制该函数时,我得到了不同的图。

T0 = 492
V0 = 275
Tmax = 25
Vmax = 75
vals = []

for t in range(1,stop=2*π,length=30)
    push!(vals, (T0 + Tmax*sin(t))/(V0-Vmax*cos(t)))
end

plot(vals, legend=nothing)

enter image description here

我不确定我是否正确使用了绘图。

最佳答案

引用:

julia> T0 = 492

julia> V0 = 275

julia> Tmax = 25

julia> Vmax = 75

julia> using Plots

julia> V(t) = V0-Vmax*cos(t)
V (generic function with 1 method)

julia> P(t) = (T0 + Tmax*sin(t))/V(t)
P (generic function with 1 method)

julia> plot(V, P, 0:0.1:2pi)

enter image description here

关于julia - 在 Julia 中绘制函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70625016/

相关文章:

julia - 如何使用 Plots.jl 填充曲线之间的区域?

javascript - 将 Ref{Cwstring}() 转换为字符串

julia - 尝试在 Julia 中添加 Plots 包时,为什么会出现 "Unsatisfiable requirements detected for package HTTP"错误?

Julia 情节.jl : changing marker colour from series recipe

julia - 如何设置 Plots 的默认属性?

julia - 如何只为一个轴而不是两个轴设置小刻度线的数量?

julia - 如何在命令行中将文件输入到 julia 脚本

vectorization - 为什么这个(非常简单的)矢量化代码比 Numpy 慢几个数量级?

types - 在 Julia 中构造具有相关字段的类型

asynchronous - 异步 Elixir 与异步 Julia