You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-12
Original file line number
Diff line number
Diff line change
@@ -23,20 +23,19 @@ Pkg.add("MATLABDiffEq")
23
23
24
24
## Using MATLABDiffEq.jl
25
25
26
-
MATLABDiffEq.jl is simply a solver on the DiffEq common interface, so for details see the [DifferentialEquations.jl documentation](https://juliadiffeq.github.io/DiffEqDocs.jl/dev/). However, there are three things to know:
26
+
MATLABDiffEq.jl is simply a solver on the DiffEq common interface, so for details see the [DifferentialEquations.jl documentation](https://juliadiffeq.github.io/DiffEqDocs.jl/dev/).
27
+
However, the only options implemented are those for error calculations
28
+
(`timeseries_error`), `saveat` and tolerances.
27
29
28
-
1. The only options implemented are those for error calculations (`timeseries_error`), `saveat` and tolerances.
29
-
2. The input function must be defined by a `ParameterizedFunction`
30
-
3. The input function must not use parameters
31
-
32
-
Note that the algorithms are defined to have the same name as the MATLAB algorithms, but are not exported. Thus to use `ode45`, you would specify the algorithm as `MATLABDiffEq.ode45()`.
30
+
Note that the algorithms are defined to have the same name as the MATLAB algorithms,
31
+
but are not exported. Thus to use `ode45`, you would specify the algorithm as
32
+
`MATLABDiffEq.ode45()`.
33
33
34
34
## Example
35
35
36
36
```julia
37
37
using MATLABDiffEq, ParameterizedFunctions
38
38
39
-
40
39
f =@ode_def LotkaVolterra begin
41
40
dx =1.5x - x*y
42
41
dy =-3y + x*y
@@ -46,6 +45,16 @@ tspan = (0.0,10.0)
46
45
u0 = [1.0,1.0]
47
46
prob =ODEProblem(f,u0,tspan)
48
47
sol =solve(prob,MATLABDiffEq.ode45())
48
+
49
+
functionlorenz(du,u,p,t)
50
+
du[1] =10.0(u[2]-u[1])
51
+
du[2] = u[1]*(28.0-u[3]) - u[2]
52
+
du[3] = u[1]*u[2] - (8/3)*u[3]
53
+
end
54
+
u0 = [1.0;0.0;0.0]
55
+
tspan = (0.0,100.0)
56
+
prob =ODEProblem(lorenz,u0,tspan)
57
+
sol =solve(prob,MATLABDiffEq.ode45())
49
58
```
50
59
51
60
## Measuring Overhead
@@ -56,7 +65,7 @@ is done. Thus you can simply call the same ODE function and time it
0 commit comments