Skip to content

Commit

Permalink
Add capacitor initial voltage to README.md example
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jaakkor2 authored Nov 11, 2024
1 parent 5ff27c8 commit 88077dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ V = 1.0
@variables t
systems = @named begin
resistor = Resistor(R = R)
capacitor = Capacitor(C = C)
capacitor = Capacitor(C = C, v = 0.0)
source = Voltage()
constant = Constant(k = V)
ground = Ground()
Expand Down

0 comments on commit 88077dd

Please sign in to comment.