Skip to content

Commit fcead75

Browse files
add/fix example
1 parent b1c05f9 commit fcead75

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ParameterizedFunctions"
22
uuid = "65888b18-ceab-5e60-b2b9-181511a3b968"
33
authors = ["Chris Rackauckas <[email protected]>"]
4-
version = "5.13.1"
4+
version = "5.13.2"
55

66
[deps]
77
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ the documentation, which contains the unreleased features.
2020
The following are valid ODE definitions.
2121

2222
```julia
23-
using DifferentialEquations
23+
using DifferentialEquations, ParameterizedFunctions
2424

2525
# Non-Stiff ODE
2626

docs/src/index.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,34 @@ using Pkg
1212
Pkg.add("ParameterizedFunctions")
1313
```
1414

15+
## Example
16+
17+
```julia
18+
using DifferentialEquations, ParameterizedFunctions
19+
20+
# Non-Stiff ODE
21+
22+
lotka_volterra = @ode_def begin
23+
d🐁 = α*🐁 - β*🐁*🐈
24+
d🐈 = -γ*🐈 + δ*🐁*🐈
25+
end α β γ δ
26+
27+
p = [1.5,1.0,3.0,1.0]; u0 = [1.0;1.0]
28+
prob = ODEProblem(lotka_volterra,u0,(0.0,10.0),p)
29+
sol = solve(prob,Tsit5(),reltol=1e-6,abstol=1e-6)
30+
31+
# Stiff ODE
32+
33+
rober = @ode_def begin
34+
dy₁ = -k₁*y₁+k₃*y₂*y₃
35+
dy₂ = k₁*y₁-k₂*y₂^2-k₃*y₂*y₃
36+
dy₃ = k₂*y₂^2
37+
end k₁ k₂ k₃
38+
39+
prob = ODEProblem(rober,[1.0,0.0,0.0],(0.0,1e5),[0.04,3e7,1e4])
40+
sol = solve(prob)
41+
```
42+
1543
## Contributing
1644

1745
- Please refer to the

0 commit comments

Comments
 (0)