Skip to content

Commit 88077dd

Browse files
authored
Add capacitor initial voltage to README.md example
Unless initial condition for capacitor initial voltage is given, `ODEProblem` errors ``` ┌ Warning: Initialization system is underdetermined. 0 equations for 1 unknowns. Initialization will default to using least squares. To suppress this warning pass warninitializedetermined = false. To make this │ warning into an error, pass fully_determined = true └ @ ModelingToolkit C:\Users\jaakkor2\.julia\packages\ModelingToolkit\zfOUk\src\systems\diffeqs\abstractodesystem.jl:1294 ┌ Warning: Did not converge after maxiters = 0 substitutions. Either there is a cycle in the rules or maxiters needs to be higher. └ @ Symbolics C:\Users\jaakkor2\.julia\packages\Symbolics\8MbnV\src\variable.jl:546 ERROR: Found symbolic value -capacitor₊p₊v(t) for variable resistor₊p₊i(t). You may be missing an initial condition or have cyclic initial conditions. If this is intended, pass `symbolic_u0 = true`. In case the initial conditions are not cyclic but require more substitutions to resolve, increase `substitution_limit`. To report cycles in initial conditions of unknowns/parameters, pass `warn_cyclic_dependency = true`. If the cycles are still not reported, you may need to pass a larger value for `circular_dependency_max_cycle_length` or `circular_dependency_max_cycles`. ``` Initial condition `v=0.0` is given here https://github.com/SciML/ModelingToolkitStandardLibrary.jl/blob/v2.17.0/docs/src/tutorials/rc_circuit.md#L23 and here https://github.com/SciML/ModelingToolkitStandardLibrary.jl/blob/v2.17.0/test/Electrical/analog.jl#L91
1 parent 5ff27c8 commit 88077dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ V = 1.0
5555
@variables t
5656
systems = @named begin
5757
resistor = Resistor(R = R)
58-
capacitor = Capacitor(C = C)
58+
capacitor = Capacitor(C = C, v = 0.0)
5959
source = Voltage()
6060
constant = Constant(k = V)
6161
ground = Ground()

0 commit comments

Comments
 (0)