@@ -91,11 +91,11 @@ The final model can now be created with the components from the library and the
9191
9292``` @example components
9393systems = @named begin
94- L = Inductor(L = 18)
94+ L = Inductor(L = 18, i = 0 )
9595 Ro = Resistor(R = 12.5e-3)
9696 G = Conductor(G = 0.565)
9797 C1 = Capacitor(C = 10, v = 4)
98- C2 = Capacitor(C = 100)
98+ C2 = Capacitor(C = 100, v = 0 )
9999 Nr = NonlinearResistor(Ga = -0.757576,
100100 Gb = -0.409091,
101101 Ve = 1)
@@ -124,20 +124,14 @@ Since the initial voltage of the first capacitor was already specified via `v`,
124124
125125``` @example components
126126sys = structural_simplify(model)
127- prob = ODEProblem(sys, Pair[], (0, 5e4), saveat = 0.01 )
128- sol = solve(prob, Rodas4())
127+ prob = ODEProblem(sys, Pair[], (0, 5e4))
128+ sol = solve(prob, Rodas4(); saveat = 1.0 )
129129
130- Plots. plot(sol[C1.v], sol[C2.v], title = "Chaotic Attractor", label = "",
130+ plot(sol[C1.v], sol[C2.v], title = "Chaotic Attractor", label = "",
131131 ylabel = "C1 Voltage in V", xlabel = "C2 Voltage in V")
132- Plots.savefig("chua_phase_plane.png")
133- nothing # hide
132+ ```
134133
135- Plots.plot(sol; idxs = [C1.v, C2.v, L.i],
134+ ``` @example components
135+ plot(sol; idxs = [C1.v, C2.v, L.i],
136136 labels = ["C1 Voltage in V" "C2 Voltage in V" "Inductor Current in A"])
137- Plots.savefig("chua.png")
138- nothing # hide
139137```
140-
141- ![ Time series plot of C1.v, C2.v and L.i] ( chua_phase_plane.png )
142-
143- ![ Phase plane plot of C1.v and C2.v] ( chua.png )
0 commit comments