【发布时间】:2020-09-04 02:00:25
【问题描述】:
using DifferentialEquations
f(u,p,t) = 1.01*u
u0 = 1/2
tspan = (0.0,1.0)
prob = ODEProblem(f,u0,tspan)
sol = solve(prob, Tsit5(), reltol=1e-8, abstol=1e-8)
using Plots
plot(sol,linewidth=5,title="Solution to the linear ODE with a thick line",
xaxis="Time (t)",yaxis="u(t) (in μm)",label="My Thick Line!") # legend=false
plot!(sol.t, t->0.5*exp(1.01t),lw=3,ls=:dash,label="True Solution!")
这是来自DifferentialEquations.jl 文档的示例代码,每当我尝试运行它时,我都会得到 UndefVarError: plot!未定义
仅执行更简单的版本时会出现类似的错误
using DifferentialEquations
f(u,p,t) = 1.01*u
u0 = 1/2
tspan = (0.0,1.0)
prob = ODEProblem(f,u0,tspan)
println(prob)
UndefVarError: ODEProblem 未定义
我运行了状态,这些是我在 Windows 10 上运行 Julia 1.5.1(今天首次安装)的当前版本:
Atom v0.12.21
DifferentialEquations v6.15.0
IJulia v1.21.3
Juno v0.8.3
【问题讨论】:
标签: julia differentialequations.jl