Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FODESystem not defiend #59

Closed
Velmurugan1008 opened this issue Jan 3, 2023 · 1 comment
Closed

FODESystem not defiend #59

Velmurugan1008 opened this issue Jan 3, 2023 · 1 comment

Comments

@Velmurugan1008
Copy link

When I running to the following code, I got an error "UndefVarError: FODESystem not defined"

import Pkg
Pkg.add("FractionalDiffEq")
using FractionalDiffEq, Plots
α = [0.9; 0.9; 0.9];
alpha = [0.9, 0.8, 1]
u0 = [1-0.001; 0.001; 0];
tspan = (0, 100);
h = 0.01;
function SIR!(du, u, p, t)
β, γ = 0.4, 0.04
du[1] = -βu[1]u[2]
du[2] = β
u[1]u[2]-γu[2]
du[3] = γ
u[2]
end

prob = FODESystem(SIR!, alpha, u0, tspan)
sol1 = solve(prob, h, FLMMBDF())
sol2 = solve(prob, h, FLMMNewtonGregory())
sol3 = solve(prob, h, FLMMTrap())
sol4 = solve(prob, h, PECE())
sol5 = solve(prob, h, PIEX())
sol6 = solve(prob, h, NonLinearAlg())
sol7 = solve(prob, h, GL())

Updating registry at C:\Users\gvmur\.julia\registries\General.toml
Resolving package versions...
No Changes to C:\Users\gvmur\.julia\environments\v1.8\Project.toml
No Changes to C:\Users\gvmur\.julia\environments\v1.8\Manifest.toml
UndefVarError: FODESystem not defined

Stacktrace:
[1] top-level scope
@ In[2]:16

@ErikQQY
Copy link
Member

ErikQQY commented Jan 4, 2023

Hi there! I test the SIR example, and it worked fine, here are some suggestions:

SIR

  1. Use the latest version of FractionalDiffEq@v0.2.11
  2. Change the function definition to this:
function SIR!(du, u, p, t)
β, γ = 0.4, 0.04
du[1] = -β*u[1]*u[2]
du[2] = β*u[1]*u[2]-γ*u[2]
du[3] = γ*u[2]
end

@ErikQQY ErikQQY closed this as completed Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants