Skip to content
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

Domain equation/solution inconsistencies #115

Open
timchinowsky opened this issue Nov 4, 2023 · 2 comments
Open

Domain equation/solution inconsistencies #115

timchinowsky opened this issue Nov 4, 2023 · 2 comments

Comments

@timchinowsky
Copy link

Looking at matrix_equations for various domains, I'm seeing some puzzling inconsistencies, wondering if I am understanding domains:

from lcapy import Circuit
from IPython.core.display import HTML

c = Circuit("""
V1 1 0 DC; down
R1 1 2; right
R2 2 0_1; down
W 0_1 0; left""")
c.draw()
c_eq = c.dc().matrix_equations()

# DC:  Everything seems consistent
display(HTML("<hr>DC Equations:"), c_eq)
display(HTML("<hr>DC simplified rhs:"), c_eq.rhs.expand().simplify())
display(HTML("<hr>DC v(R2):"), c.R2.v.simplify())

b = Circuit("""
V1 1 0 AC; down
R1 1 2; right
R2 2 0_1; down
W 0_1 0; left""")
b_eq = b.ac().matrix_equations()

# AC: v(R2) calculated ok, but RHS of equations is zero?
display(HTML("<hr>AC Equations:"), b_eq)
display(HTML("<hr>AC simplified rhs:"), b_eq.rhs.expand().simplify())
display(HTML("<hr>AC v(R2):"), b.R2.v.simplify())

a = Circuit("""
V1 1 0 {V(s)}; down
R1 1 2; right
R2 2 0_1; down
W 0_1 0; left""")
a_eq = a.laplace().matrix_equations()

# Laplace: RHS calculated correctly as function of V(s), but v(R2) shown as function of V(t)?
display(HTML("<hr>Laplace equations:"), a_eq)
display(HTML("<hr>Laplace simplified rhs:"), a_eq.rhs.expand().simplify())
display(HTML("<hr>Laplace v(R2):"), a.R2.v.simplify())

Screenshot from 2023-11-04 11-22-05

@timchinowsky
Copy link
Author

This issue seems to be related to my confusion with both v and V being properties of e.g. R2... I'll see if I can work up a consistent set of examples

@mph-
Copy link
Owner

mph- commented Feb 12, 2024

Did you manage to find a set of examples?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants