many edits
This commit is contained in:
@@ -16,7 +16,7 @@ using ModelingToolkit
|
||||
---
|
||||
|
||||
|
||||
The [`DifferentialEquations`](https://github.com/SciML/DifferentialEquations.jl) suite of packages contains solvers for a wide range of various differential equations. This section just briefly touches on ordinary differential equations (ODEs), and so relies only on `OrdinaryDiffEq` part of the suite. For more detail on this type and many others covered by the suite of packages, there are many other resources, including the [documentation](https://diffeq.sciml.ai/stable/) and accompanying [tutorials](https://github.com/SciML/SciMLTutorials.jl).
|
||||
The [`DifferentialEquations`](https://github.com/SciML/DifferentialEquations.jl) suite of packages contains solvers for a wide range of various differential equations. This section just briefly touches on ordinary differential equations (ODEs), and so relies only on `OrdinaryDiffEq`, a small part of the suite. For more detail on this type and many others covered by the suite of packages, there are many other resources, including the [documentation](https://diffeq.sciml.ai/stable/) and accompanying [tutorials](https://github.com/SciML/SciMLTutorials.jl).
|
||||
|
||||
|
||||
## SIR Model
|
||||
|
||||
@@ -94,7 +94,7 @@ function make_euler_graph(n)
|
||||
scatter!(p, xs, ys)
|
||||
|
||||
## add function
|
||||
out = dsolve(u'(x) - F(u(x), x), u(x), ics=(u, x0, y0))
|
||||
out = dsolve(D(u)(x) - F(u(x), x), u(x), ics=Dict(u(x0) => y0))
|
||||
plot!(p, rhs(out), x0, xs[end], linewidth=5)
|
||||
|
||||
p
|
||||
|
||||
@@ -567,7 +567,7 @@ We enter this into `Julia`:
|
||||
|
||||
```{julia}
|
||||
@syms w::positive H::positive y()
|
||||
eqnc = D2(y)(x) ~ (w/H) * sqrt(1 + y'(x)^2)
|
||||
eqnc = D2(y)(x) ~ (w/H) * sqrt(1 + D(y(x))^2)
|
||||
```
|
||||
|
||||
Unfortunately, `SymPy` needs a bit of help with this problem, by breaking the problem into steps.
|
||||
|
||||
@@ -227,7 +227,6 @@ Finally, the author of the post shows how the interface can compose with other p
|
||||
|
||||
|
||||
```{julia}
|
||||
|
||||
earth₄ = Problem(y0 = 0.0 ± 0.0, v0 = 30.0 ± 1.0)
|
||||
sol_euler₄ = solve(earth₄)
|
||||
sol_sympl₄ = solve(earth₄, Symplectic2ndOrder(dt = 2.0))
|
||||
|
||||
Reference in New Issue
Block a user