Need help finding the differential equations for this LCR circuit - Page 1
Forum section: electronics / beginners

author: Reedim
author_rank: Newbie
timestamp: May 05, 2016, 03:39:18 pm
content: Hi all!First time posting on the forum.I've gotten an assignment at school to model this LCR circuit in LabVIEW. The program should be able to calculate the I(t) and U(t) functions for every component.(the values for the components are just placeholders for the picture, all values should be changeable in the final program)To model an LCR circuit, differential equations should be used. Once I got the solutions for these equations, I should be able to draw graphs for each component with ease inside LabVIEW.My main problem is, that I'm really not familiar with differential equations, it'll only be in the next semester when we'll start learning about them. I attend this LabVIEW course one semester earlier as recommended, because I need LabVIEW knowledge for a personal project of mine.But anyways, I started to research the topic, and I can solve the basic differential equations with ease. But the complexity of this one is just too high for my poor knowledge. I've spent tens of hours, read tons of papers online detailing how to model simple LCR circuits, but neither of those were as complicated as this one.I've made some progress, but I don't think it's much at all. I've started from Kirchhoff's Loop Law, and Junction Law, and got together 3 differential equations (I'm not sure if they are correct), and I'm stuck. There are too many current variables, and I don't really see how to make progress from here. I've made a picture of what I think sums up my progress:(I started by trying to convert to circuit to an equivalent but an easier one, but that idea would get me nowhere...)The assignment doesn't really care about the differential equations themselves, but more the fact that we calculate and draw the functions using LabVIEW. Could someone help me find the differential equations? Is there any circuit modelling software to find and solve said equations? I'm stuck. The deadline is approaching, any help would be greatly appreciated!

author: danadak
author_rank: Super Contributor
timestamp: May 05, 2016, 04:23:38 pm
content: I am rusty here but seems like writing equations in S domain them doing partial fractionexpansion on them, then converting back to time domain, would be the approach.Maybe a better mathematician could help here.....Regards, Dana.

author: IanB
author_rank: Super Contributor
timestamp: May 05, 2016, 04:52:00 pm
content: If you analyze that system from first principles you will end up with a combined system of differential and algebraic equations (a DAE system). This system will have many equations and involve many variables. It could then be solved easily by a numerical computer program (this is what circuit simulators like Spice do), or you could try to solve it by hand, but this would be painful. I am not familiar with LabVIEW: can it solve systems of simultaneous differential and algebraic equations?If you try to solve the system by hand, you would start out with full system obtained from first principles and then you would try to simplify it by substitution and elimination until you have made it as small as possible. You might get it down to a pure system of a few differential equations, but still I would not like to solve it analytically. It is years since I ever remembered how to do such things.To set up the equation set, you should number every node and assign it a voltage, V1, V2, V3, etc. Then number every path between nodes and assign it a current (I1, I2, I3, etc.). Then you can use Kirchhoff's current law (for example) to write a current balance around every node. And you can write equations for every component relating the current and the terminal voltages. This will be your DAE system that needs simplifying.

author: rstofer
author_rank: Super Contributor
timestamp: May 05, 2016, 05:19:46 pm
content: I don't see a need for the differential equations as this is a steady state problem at a fixed frequency of 40 Hz. Each of the components has an impedance at that frequency and one way to solve the problem is to write the loop and/or mesh equations and solve them. Ugly, but doable.I modeled the circuit in LTspice - that goes pretty fast. But if you run AC analysis on the circuit, you only get a single table of node voltages because, again, we're dealing with a fixed frequency.Do you have MultiSim? This tool allows you to draw the circuit and simulate it. I suppose the output can be slurped up into LabView. Here is a video:Here's the node locations for my circuit which is just like yours but rotated 90 degrees clockwise* C:\Program Files (x86)\LTC\LTspiceIV\Draft4.ascV1 N004 0 SINE(0 1V 40) AC 1VR1 N001 N004 100R2 N002 0 200R3 N003 0 100L1 N002 N003 100mHC1 N001 N002 200µFC2 N001 N003 100µF.ac oct 1 40 40.backanno.endYou can use those node numbers to annotate your schematic. Node 0 is ground, Node 4 is the junction between the voltage source and R1 and the rest are fairly ovbious.--- AC Analysis ---frequency: 40 HzV(n004): mag: 1 phase: 0° voltageV(n001): mag: 0.405147 phase: -4.30422° voltageV(n002): mag: 0.40991 phase: 10.8281° voltageV(n003): mag: 0.394773 phase: -1.17516° voltageI(C2): mag: 0.000607629 phase: 22.6583° device_currentI(C1): mag: 0.00539968 phase: 0.742702° device_currentI(L1): mag: 0.00340079 phase: -5.3154° device_currentI(R3): mag: 0.00394773 phase: -1.17516° device_currentI(R2): mag: 0.00204955 phase: 10.8281° device_currentI(R1): mag: 0.00596771 phase: -177.079° device_currentI(V1): mag: 0.00596771 phase: -177.079° device_currentYour circuit doesn't give a voltage so I used 1V - a convenient value