Skip to content

Commit d3d264b

Browse files
committed
Fix field access
in base example, per Sam's suggestion
1 parent 9b6f272 commit d3d264b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/src/tutorials/homotopy_continuation_tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ p = [:k1 => 8.0, :k2 => 2.0, :k3 => 1.0, :k4 => 1.5]
1717
Next, we will need to extract the actual equations from our model. In addition, we will substitute in our parameter values.
1818
```@example hc1
1919
ns = convert(NonlinearSystem,wilhelm_2009_model)
20-
subs = Dict(Pair.(wilhelm_2009_model.ps.value,last.(p)))
21-
new_eqs = map(eq -> ModelingToolkit.unwrap(substitute(eq.rhs,subs)), ns.eqs.value)
20+
subs = Dict(Pair.(ModelingToolkit.parameters(ns),last.(p)))
21+
new_eqs = map(eq -> substitute(eq.rhs,subs), equations(ns))
2222
```
2323
Finally, we use the `as_polynomial` function to read our symbolic expression as a polynomial, within it, we can apply homotopy continuation's `solve` command to find the roots. In addition, we use the `real_solutions` to filter away imaginary roots (as CRNs' states typically are non-imaginary):
2424
```@example hc1

0 commit comments

Comments
 (0)