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

Add nonlinear system with parameters and time dependency #183

Open
mforets opened this issue Feb 21, 2020 · 3 comments
Open

Add nonlinear system with parameters and time dependency #183

mforets opened this issue Feb 21, 2020 · 3 comments
Labels

Comments

@mforets
Copy link
Member

mforets commented Feb 21, 2020

This is f!(dx, x, p, t) (in-place version) and f(x, p, t) (out-of-place version). It is the "canonical" function signature in DifferentialEquations.jl

We can call this internally a NonlinearContinuousSystem. Example:

f(x, p, t) = 1.01*x
p = @ivp(x' = f(x, p, t), x(0)  0..1)

solve(p, T=1.0) # only time horizon is given; initial time is implicitly 0
solve(p, tspan=(0.0, 1.0))
@ueliwechsler
Copy link
Collaborator

What methods do we need to add, such that DifferentialEquations.solve(p,tspan=(0.0, 1.0)) works?

@mforets
Copy link
Member Author

mforets commented Mar 4, 2020

One has to extract the vector field from the initial-value problem and construct the corresponding ODEProblem. Additional arguments and problem options can just be passed through. With the idea of VectorField from this comment, i prototyped this feature in ReachabilityAnalysis.jl, so you can do:

julia> using ReachabilityAnalysis, DifferentialEquations

julia> prob = @ivp(x' = 1.0x, x(0)  [1/2])
julia> sol = DifferentialEquations.solve(prob, tspan=(0.0, 1.0))

retcode: Success
Interpolation: Automatic order switching interpolation
t: 5-element Array{Float64,1}:
 0.0                
 0.10003996803834632
 0.3480875036720596 
 0.6831749823340594 
 1.0                
u: 5-element Array{Array{Float64,1},1}:
 [0.5]               
 [0.5526075452476473]
 [0.7081780893966387]
 [0.9900773318307845]
 [1.3591408544074437]

@ueliwechsler
Copy link
Collaborator

This looks really nice, cool :)
I also had a go at the vector field functionality. See #160 for the comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants