|
104 | 104 | u0 = [
|
105 | 105 | rc_model.capacitor.v => 0.0,
|
106 | 106 | ]
|
107 |
| -prob = ODAEProblem(rc_model, u0, (0, 10.0)) |
108 |
| -sol = solve(prob, Tsit5()) |
| 107 | +prob = ODEProblem(rc_model, u0, (0, 10.0)) |
| 108 | +sol = solve(prob) |
109 | 109 | plot(sol)
|
110 | 110 | ```
|
111 | 111 |
|
@@ -319,25 +319,10 @@ u0 = [rc_model.capacitor.v => 0.0
|
319 | 319 | rc_model.capacitor.p.i => 0.0]
|
320 | 320 |
|
321 | 321 | prob = ODEProblem(rc_model, u0, (0, 10.0))
|
322 |
| -sol = solve(prob, Rodas4()) |
323 |
| -plot(sol) |
324 |
| -``` |
325 |
| - |
326 |
| -MTK can numerically solve all the |
327 |
| -unreduced algebraic equations using the `ODAEProblem` (note the |
328 |
| -letter `A`): |
329 |
| - |
330 |
| -```@example acausal |
331 |
| -u0 = [ |
332 |
| - rc_model.capacitor.v => 0.0, |
333 |
| -] |
334 |
| -prob = ODAEProblem(rc_model, u0, (0, 10.0)) |
335 |
| -sol = solve(prob, Rodas4()) |
| 322 | +sol = solve(prob) |
336 | 323 | plot(sol)
|
337 | 324 | ```
|
338 | 325 |
|
339 |
| -Notice that this solves the whole system by only solving for one variable! |
340 |
| - |
341 | 326 | However, what if we wanted to plot the timeseries of a different variable? Do
|
342 | 327 | not worry, that information was not thrown away! Instead, transformations
|
343 | 328 | like `structural_simplify` simply change state variables into observables which are
|
|
0 commit comments