Skip to content

Commit

Permalink
add/fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Jun 6, 2022
1 parent b1c05f9 commit fcead75
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ParameterizedFunctions"
uuid = "65888b18-ceab-5e60-b2b9-181511a3b968"
authors = ["Chris Rackauckas <accounts@chrisrackauckas.com>"]
version = "5.13.1"
version = "5.13.2"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ the documentation, which contains the unreleased features.
The following are valid ODE definitions.

```julia
using DifferentialEquations
using DifferentialEquations, ParameterizedFunctions

# Non-Stiff ODE

Expand Down
28 changes: 28 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,34 @@ using Pkg
Pkg.add("ParameterizedFunctions")
```

## Example

```julia
using DifferentialEquations, ParameterizedFunctions

# Non-Stiff ODE

lotka_volterra = @ode_def begin
d🐁 = α*🐁 - β*🐁*🐈
d🐈 = -γ*🐈 + δ*🐁*🐈
end α β γ δ

p = [1.5,1.0,3.0,1.0]; u0 = [1.0;1.0]
prob = ODEProblem(lotka_volterra,u0,(0.0,10.0),p)
sol = solve(prob,Tsit5(),reltol=1e-6,abstol=1e-6)

# Stiff ODE

rober = @ode_def begin
dy₁ = -k₁*y₁+k₃*y₂*y₃
dy₂ = k₁*y₁-k₂*y₂^2-k₃*y₂*y₃
dy₃ = k₂*y₂^2
end k₁ k₂ k₃

prob = ODEProblem(rober,[1.0,0.0,0.0],(0.0,1e5),[0.04,3e7,1e4])
sol = solve(prob)
```

## Contributing

- Please refer to the
Expand Down

0 comments on commit fcead75

Please sign in to comment.