-
Notifications
You must be signed in to change notification settings - Fork 85
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
RL circuit vs. LR circuit: different output #63
Comments
edited with block quotes and a definition of the crux of the issue is the size of the inductor (and probably to a lesser extent, the resistor) - 1E7 henries is uh probably the size of your average house, with 1E3 henries as the approximate inductance of a 3 gigawatt mains transformer... From > https://en.wikipedia.org/wiki/Orders_of_magnitude_(inductance) |
@itdaniher I need some time to figure out how to scale down the equivalent inductance and resistance for a microfluidic device. As such a system is almost always highly nonlinear, I think it would be very hard to do so. Is that possible to make the library F64 internally if it's F32? Thanks for your help. |
After checking, it's all using Python's default float type, with no specified width as one might expect were it using numpy datatypes internally. This means it's already F64, which suggests the issue is not as simple as using a datatype with insufficient precision. |
One way to get around this is to change the unit system from "kg, meter, second" to something else, e.g., "g, um, second", so that the fluidic equivalent inductance, resistance, and capacitance values are more in line with what Ahkab can handle. This should work without changing anything in this library. |
Sounds like something of a fix. Hopefully enough to get let you make forward progress in your work! |
Thanks for your time reading this thread. I hope you could give me some suggestions regarding Ahkab library.
I am an engineer specialised in inkjet printhead design. I am trying to use Python Ahkab library to simulate a printhead design where the equivalent flow resistance, inertance, and capacitance are not constant, but variables depending on flow development profile in microfluidic channels. Ahkab is a perfect library for such a job.
However, I found something really hard to comprehend (py file is attached). For a simple RL circuit, the time constant should be L/R. However, the simulated result is not so. Also, by switching the positions of the R and the L components, the result is different for the current running through the inductor. By comparing them with the result from LTSpice model, both ones are not completely correct.
Could you give me some suggestions as to what might have gone wrong with my coding or the library itself?
Many thanks,
Xi
#code:
(This is the LTSpice circuit and output for the current through the inductor)
(Below two images are for the current through the inductor using Python Ahkab library. However, the positions of R and L are switched in the circuit. Results are not the same. The bottom image gives the correct final current value but the time constant is wrong.)
The text was updated successfully, but these errors were encountered: