Problem with DifferentialEquations.jl

I am completely new to Julia, and now I am learning to solve differential equations with her. I tried to run Christopher Rakakakas’s simple, ready-made code, but I got an error. The code can be found here . I will also write it here:

using DifferentialEquations
alpha = 0.5 #Setting alpha to 1/2
f(y,t) = alpha*y
u0 = 1.5
prob = ODEProblem(f,u0)
timespan = [0,1] # Solve from time = 0 to time = 1
sol = solve(prob,timespan) # Solves the ODE
using Plots
plot(sol) # Plots the solution using Plots.jl

And the error I get looks like this:

LoadError: MethodError: no methof matching DiffEqBase.ODEProblem {uType, tType, isinplace, FC; MM} (:: # f, :: Float64)

I also tried to run other similar codes and even uninstalled DifferentialEquations.jl -package and then reinstalled it but nothing changed.

Anyone more experienced with an idea of ​​what I might be doing wrong?

+3
source share
1

, . , DifferentialEquations 1.0 . , . :

using DifferentialEquations
alpha = 0.5 #Setting alpha to 1/2
f(y,t) = alpha*y
u0 = 1.5
tspan = (0.0,1.0) # Solve from time = 0 to time = 1
prob = ODEProblem(f,u0,tspan)
sol = solve(prob) # Solves the ODE
using Plots
plot(sol) # Plots the solution using Plots.jl

, , , , .

+4

Source: https://habr.com/ru/post/1676812/


All Articles