-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parallel RLC Circuit #147
Comments
It worked for me. Could you retry with the latest MTKStdLib, MTK and OrdinaryDiffEq (; although I can't think of anything specific to this that changed). If the error persists please provide the versions and error stacktrace; it would be easier to reproduce/debug. |
The example above works? I didn't mean that it produces an error, but it didn't oscillate. That's because of the source voltage being maintained at 0, a misunderstanding on my part. The following shows the oscillations I expected: R = 1/0.1
L = 1.0
C = 1.0
V = 1.0
@variables t
@named resistor = Resistor(R=R)
@named inductor = Inductor(L=L)
@named capacitor = Capacitor(C=C)
@named ground = Ground()
# build the circuit by connecting components
rlc_eqs = [
connect(resistor.p, inductor.p, capacitor.p)
connect(resistor.n, inductor.n, capacitor.n)
connect(resistor.n, ground.g)
]
@named rlc_model = ODESystem(rlc_eqs, t, systems=[resistor, inductor, capacitor, ground])
sys = structural_simplify(rlc_model)
u0 = [inductor.i => 2.0]
prob = ODEProblem(sys, u0, (0, 50.0))
sol = solve(prob, Tsit5())
plot(sol.t, [sol[capacitor.v] sol[inductor.i]]) |
I can't seem to get a parallel RLC circuit to work. The series circuit works fine, but the paralell version doesn't work properly. I must be doing something wrong, but I haven't been able to figure it out... It would be a good example to add to tests/docs if we can get it to work.
The text was updated successfully, but these errors were encountered: