RLC Circuit Differential Equation

In summary: You have solved the homogeneous part of the equation. Next, you need to differentiate the equation. You can do this by using the quadratic equation: Ih'' = Bx2extHowever, because B is a constant, you only need to solve for Ih'' once. Once you have Ih'' solved, you can use it in the equation for Ih to get C1 and C2.
  • #1
Zaoshi
8
0

Homework Statement


For RLC circuit determine and solve differential equation. R, L, C, E0 values are constants, E = E(t) = E0*sin(ω*t) (E is marked as V in the image). Then make program which calculates values of I(t) when R, L, C, E0, ω are given.
In short, I need to get function I(t), so I could get values at given time steps to plot graph.


Homework Equations


Kirchoff's Voltage Law


The Attempt at a Solution


Most of this was provided by our teacher, but I'm still having troubles solving it (I generally suck at math).
We've got this equation which is built off R, L, C, E components ( I = I(t) ):

LI' + RI + 1/C * ∫Idt = E0*sin(ω*t)

Then got differencial equation, by finding derivative (to get rid of integral):

LI'' + RI' + I/C = E0*ω*cos(ω*t)

Tried to find solution for I by combining one solution and homogeneous equation's solution (I = Ip + Ih):

Ip = a*cos(ω*t) + b*sin(ω*t), where
a = -(E0S) / (R2 + S2)
b = (E0R) / (R2 + S2)
S = ω*L - 1 / (ω*C)

This leads to:

Ip = I0*sin(w*t - omega), where
I0 = sqrt(a2 + b2) = E0 / sqrt(R2 + S2)
tg(omega) = - a/b = S/R

And for homogeneous part we used characteristic equation:

Ih = C1*eX1*t + C2*eX2*t
X2 + R/L*X + 1/(L*C) = 0

Solving equation above using simple discriminant:

X1 = -R/(2*L) + sqrt(R2 / L2 - 4/(L*C))
X2 = -R/(2*L) - sqrt(R2 / L2 - 4/(L*C))

Assuming when t = 0 we have I(t) = 0, inserting this into Ih we get:

C1 + C2 = 0

But that's not enough to find C1 and C2 values and this is where I got stuck. I should be able to make program, but I need to at least solve it on paper first. Hopefully someone can help me out here.

Thank you in advance.
 
Physics news on Phys.org
  • #2
You know that C1 + C2 = 0, or in other words, C2 = -C1. So eliminate one or the other in your homogeneous solution so you have a single constant. Next, you can differentiate this solution (twice) and plug the derivatives (i.e. I'', I', and I) into your original equation. Set t = 0 there. You should be able to solve for the constant.
 
  • #3
I used C1 = -C2, so my equations became
Ih = C2(ex2t - ex1t)
Ih' = C2(x2ex2t - x1ex1t)
Ih'' = C2(x22ex2t - x12ex1t)

By "plug the derivatives into your original equation" you mean LI'' + RI' + 1/C * I = E0ωcos(ωt) ? If yes this leads to
LC2(x22ex2t - x12ex1t) + RC2(x2ex2t - x1ex1t) + 1/C * C2(ex2t - ex1t) = E0ωcos(ωt)

According to Wolfram Alpha I get some result (X = C2).

Have I done everything correctly?
 
  • #4
Zaoshi said:
I used C1 = -C2, so my equations became
Ih = C2(ex2t - ex1t)
Ih' = C2(x2ex2t - x1ex1t)
Ih'' = C2(x22ex2t - x12ex1t)

By "plug the derivatives into your original equation" you mean LI'' + RI' + 1/C * I = E0ωcos(ωt) ? If yes this leads to
LC2(x22ex2t - x12ex1t) + RC2(x2ex2t - x1ex1t) + 1/C * C2(ex2t - ex1t) = E0ωcos(ωt)

According to Wolfram Alpha I get some result (X = C2).

Have I done everything correctly?

Yes, that's the idea. But I can't tell if everything done correctly because you only hint at your final expression for C2. But the method looks good.

Note that your 'substitution efforts' can be greatly simplified if you set t=0 in the equations before you do the substitutions. All the exponentials then become 1's and the algebra can be done without recourse to Wolfram!
 
  • #5
gneill said:
Yes, that's the idea. But I can't tell if everything done correctly because you only hint at your final expression for C2. But the method looks good.
I had troubles with indexes, so I made X = C2, A = x1, B = x2, E = E0, w = ω.

Well my assignment is to make program which draws graph. R, L, C, E0, ω will be provided, t is time which will be X axis. Therefore I have to keep all these constants and variables to get correct result.
Currently it plots http://img855.imageshack.us/img855/9346/60311505.png. However that's only when discriminant > 0. Still have to solve when it's = 0 and < 0.
 
  • #6
Sorry for double post if it's against rules.

Now I'm assuming D = R2/L2 - 4/(L*C) = 0, meaning both roots are x = -R/(2*L)
Therefore homogeneous equation is
Ih = C1ext+C2ext
Ih = ext(C1+C2)
Ih = Bext (C letter is already in use, using B)
Ih' = Bxext
Ih'' = Bx2ext
Trying to plug it into LI'' + RI' + 1/C * I = E0ωcos(ωt)
L(Bx2ext) + R(Bxext) + 1/C * (Bext) = E0ωcos(ωt)
Using Wolfram Alpha I find value of B (link). It seems Wolfram assumed 4L != CR2, however according to discriminant it is equal. If I specify it is equal, Wolfram cannot find solution (link).

What have I done wrong?
 
  • #7
Automated solvers like Wolfram Alpha can be a bit picky about the assumptions made, and if you aren't explicit they may take it into their heads to make assumptions that you didn't expect, didn't specify, and didn't want!

B should be a constant that doesn't depend on time. So to solve for B you can specify a convenient value for t. Zero is a convenient value! Specify t = 0 as a condition for the solver. Here's the result.
 
  • #8
Hm... Interesting. For some reason I though I shouldn't specify t value. But this seems to work :D
Graph looks like http://img683.imageshack.us/img683/8141/21433896.png now.

Last part left, discriminant < 0. It seems my notes have more information on this case.
Lets say x1 = α + iβ and x2 = α - iβ where α = -R/(2*L) and β = sqrt(R2/L2 - 4/(L*C))

Homogeneous equation now looks like this:
Ih = C1e(α + iβ)t + C2e(α - iβ)t

Using our previous assumption of I(0) = 0 once again we get C1 = -C2
Ih = C2e(α - iβ)t - C2e(α + iβ)t

Using Euler's Formula splitting complex exponential into trigonometry functions:
Ih = C2eαt(cos(βt) - isin(βt)) - C2eαt(cos(βt) + isin(βt))
Ih = -2C2eαtisin(βt)

Notes suggest to pick complex C2 to eliminate i next to sin. So let's assume it is complex and join constants: B = 2C2i. In result we have
Ih = -Beαtsin(βt)
Ih' = -Beαtcos(βt)β
Ih'' = Beαtsin(βt)β2

Plugging into LI'' + RI' + 1/C * I = E0ωcos(ωt)
L(Beαtsin(βt)β2) + R(-Beαtcos(βt)β) + 1/C * (-Beαtsin(βt)) = E0ωcos(ωt)

Seems it's too complex for Wolfram to solve (link), I tried second iteration in second window but still same result, it just doesn't substitute α and β, then I tried Maple and result is
B = - (Eω) / (R * sqrt((R2C-4L) / (L2C)))
I wonder where all trigonometry disappeared, but result is wrong. Again. Square root is negative and whole idea of getting rid of complex numbers is gone.

Seems I really fail at this. Could you help out once more please?
 
  • #9
Zaoshi said:
Notes suggest to pick complex C2 to eliminate i next to sin. So let's assume it is complex and join constants: B = 2C2i. In result we have
Ih = -Beαtsin(βt)
Ih' = -Beαtcos(βt)β
Ih'' = Beαtsin(βt)β2

You'll need to apply the chain rule to differentiate the function, since it is composed of the product of two functions each of which depend upon t. So, for example,

Ih' = (-α sin(βt) - β cos(βt)) B e(αt)

After you find the derivatives, plug in t=0 right away! This will clear away a LOT of clutter! Then substitute into the differential equation (and be sure to set t=0 there too!). You should be able to do the resulting algebra by hand.
 
  • #10
I guess I rushed it too much, failed to notice variable in exponent.

Ih = -Beαtsin(βt) = 0
Ih' = -Bαeαtsin(βt) - Bβeαtcos(βt) = -Bβ
Ih'' = -Bα2eαtsin(βt) - 2Bαβeαtcos(βt) + Bβ2eαtsin(βt) = -2Bαβ

L(-2Bαβ) + R(-Bβ) + 1/C * (0) = E0ωcos(ωt)
-2LBαβ - RBβ = E0ωcos(ωt)
Bβ(-2Lα - R) = E0ωcos(ωt)
B = (E0ωcos(ωt)) / (β(-2Lα - R))
Plugging in α
B = (E0ωcos(ωt)) / (β(-2L(-R/(2L)) - R))
B = (E0ωcos(ωt)) / (β(R - R))

That's division by zero. Once again I failed somewhere :(
 
Last edited:
  • #11
Zaoshi said:

Homework Statement


For RLC circuit determine and solve differential equation. R, L, C, E0 values are constants, E = E(t) = E0*sin(ω*t) (E is marked as V in the image). Then make program which calculates values of I(t) when R, L, C, E0, ω are given.
In short, I need to get function I(t), so I could get values at given time steps to plot graph.


Homework Equations


Kirchoff's Voltage Law


The Attempt at a Solution


Most of this was provided by our teacher, but I'm still having troubles solving it (I generally suck at math).
We've got this equation which is built off R, L, C, E components ( I = I(t) ):

LI' + RI + 1/C * ∫Idt = E0*sin(ω*t)

Then got differencial equation, by finding derivative (to get rid of integral):

LI'' + RI' + I/C = E0*ω*cos(ω*t)

Tried to find solution for I by combining one solution and homogeneous equation's solution (I = Ip + Ih):

Ip = a*cos(ω*t) + b*sin(ω*t), where
a = -(E0S) / (R2 + S2)
b = (E0R) / (R2 + S2)
S = ω*L - 1 / (ω*C)

This leads to:

Ip = I0*sin(w*t - omega), where
I0 = sqrt(a2 + b2) = E0 / sqrt(R2 + S2)
tg(omega) = - a/b = S/R

And for homogeneous part we used characteristic equation:

Ih = C1*eX1*t + C2*eX2*t
X2 + R/L*X + 1/(L*C) = 0

Solving equation above using simple discriminant:

X1 = -R/(2*L) + sqrt(R2 / L2 - 4/(L*C))
X2 = -R/(2*L) - sqrt(R2 / L2 - 4/(L*C))

Assuming when t = 0 we have I(t) = 0, inserting this into Ih we get:

C1 + C2 = 0

But that's not enough to find C1 and C2 values and this is where I got stuck. I should be able to make program, but I need to at least solve it on paper first. Hopefully someone can help me out here.

Thank you in advance.

You need two equations to obtain C1 and C2.

One of them you already have, based on i(0) = 0.

Ok, what can you say about di/dt(0+)? How about at t = 0+, I know the capacitor hasn't had any time to build up any voltage, so E is totally across R and L alone.
But since i(0+) = 0 also, iR(0+) = 0 so E must all be across L alone. So Ldi/dt(0+) = E(0+).

Now you have your two equations for C1 and C2. The rest you seem to have a good handle on.
 
  • #12
rude man said:
You need two equations to obtain C1 and C2.

One of them you already have, based on i(0) = 0.

Ok, what can you say about di/dt(0+)? How about at t = 0+, I know the capacitor hasn't had any time to build up any voltage, so E is totally across R and L alone.
But since i(0+) = 0 also, iR(0+) = 0 so E must all be across L alone. So Ldi/dt(0+) = E(0+).

Now you have your two equations for C1 and C2. The rest you seem to have a good handle on.

It's a good thought, but since the driving function is sin(ωt) , E(0+) is zero, making dI/dt at t = 0+ also zero.
 
  • #13
Zaoshi said:

Homework Statement


For RLC circuit determine and solve differential equation. R, L, C, E0 values are constants, E = E(t) = E0*sin(ω*t) (E is marked as V in the image). Then make program which calculates values of I(t) when R, L, C, E0, ω are given.
In short, I need to get function I(t), so I could get values at given time steps to plot graph.


Homework Equations


Kirchoff's Voltage Law


The Attempt at a Solution


Most of this was provided by our teacher, but I'm still having troubles solving it (I generally suck at math).
We've got this equation which is built off R, L, C, E components ( I = I(t) ):

LI' + RI + 1/C * ∫Idt = E0*sin(ω*t)

Then got differencial equation, by finding derivative (to get rid of integral):

LI'' + RI' + I/C = E0*ω*cos(ω*t)

Tried to find solution for I by combining one solution and homogeneous equation's solution (I = Ip + Ih):

Ip = a*cos(ω*t) + b*sin(ω*t), where
a = -(E0S) / (R2 + S2)
b = (E0R) / (R2 + S2)
S = ω*L - 1 / (ω*C)

This leads to:

Ip = I0*sin(w*t - omega), where
I0 = sqrt(a2 + b2) = E0 / sqrt(R2 + S2)
tg(omega) = - a/b = S/R

And for homogeneous part we used characteristic equation:

Ih = C1*eX1*t + C2*eX2*t
X2 + R/L*X + 1/(L*C) = 0

Solving equation above using simple discriminant:

X1 = -R/(2*L) + sqrt(R2 / L2 - 4/(L*C))
X2 = -R/(2*L) - sqrt(R2 / L2 - 4/(L*C))
Assuming when t = 0 we have I(t) = 0, inserting this into Ih we get:/
Also check math.
Looks like you divided the -b terms by 2 OK but you forgot about the +/-b^2 - 4ac terms.
 
  • #14
gneill said:
It's a good thought, but since the driving function is sin(ωt) , E(0+) is zero, making dI/dt at t = 0+ also zero.

The driving function in your all-differential equation is not E0sin(ωt). It's ωE0cos(ωt).
And so you need to rewrite your A and B equations to accord with the equation you're dealing with, not the original integro-differential equation you eliminated (quite correctly, I might add).
 
Last edited:
  • #15
rude man said:
The driving function in your all-differential equation is not E0sin(ωt). It's ωE0cos(ωt).
And so you need to rewrite your A and B equations to accord with the equation you're dealing with, not the original integro-differential equation you eliminated (quite correctly, I might add).

While it is true that the function in the differential equation is (ω/L)Eocos(ωt), which yields amps/sec2 (the 'acceleration' of the current), in the original circuit it is a voltage of the form Eosin(ωt) that drives the circuit, and that's where we must find our initial conditions. The current in the circuit and the current modeled by the differential equation must be the same. The initial conditions come from the circuit: At time t = 0 the driving voltage is zero, capacitor is uncharged and the current is zero.
 
Last edited:
  • #16
Okay, I've revived some braincells that have been laying dormant for lo these many years.

If the roots of the characteristic equation are complex, then they are a conjugate pair of the form [itex] a \pm j b [/itex]. The homogeneous solution then looks like:

[itex] I_h = C_1 e^{a + j b} + C_2 e^{a - j b} [/itex]

In our case we have [itex] a = -\alpha[/itex] and [itex] b = \omega_c[/itex] where [itex]\omega_c = \sqrt{\omega_o^2 - \alpha^2}[/itex]

After applying Euler's relations this can be wrestled into the form:

[itex] I_h = e^{-\alpha t} \left[ (C_1 + C_2) cos(\omega_c t) + j (C_1 - C_2)sin(\omega_c t) \right] [/itex]

In order for this to yield a real solution constants C1 and C2 must be also be a conjugate pair (Then the sum is real, and the difference imaginary but then multiplied by j to make it real).

So replace the constants (including the j) with two new arbitrary real constants:

[itex] I_h = e^{-\alpha t} \left[ c_1 \; cos(\omega_c t) + c_2 \; sin(\omega_c t) \right] [/itex]

That's the homogeneous solution to work with. It remains to find values for its constants.

At this point you need to bring the Particular Solution back into the picture. The initial conditions that you obtain from the circuit apply to the sum of Ih and Ip. For example, I noted that the Particular Solution that you derived earlier does not yield a value of zero current for time t = 0. So the difference must be taken up by the homogeneous solution.

Set t = 0 in both Ip and Ih and equate the sum to the initial current in the circuit (we've determined that it's zero). That should yield a value for c1. Proceed to do the same for dI/dt, where you also know the initial condition. Solve for c2.
 
  • #17
As a preamble to admitting what I did was irrelevant, let me say that I, and you too probably, would never dream of resorting to classical diff eq's for something like this- that's because God gave us Pierre-Simon, marquis de LaPlace!

Very embarrassingn , nonetheless. :redface:

Ih = C1*eX1*t + C2*eX2*t

C1 and C2 are both zero, I think we all have that figured out by now, me last. C1 and C2 are associated with the initial conditions.

So we look for - what did they call it? - the complementary function or particular integral, I don't remember.

So we "guess" i(t) = Asin(wt) + Bcos(wt) & stick that into our diff eq., equate coefficients of sin and cos, and away we go. Does that sound better, gneill?
 
  • #18
rude man said:
As a preamble to admitting what I did was irrelevant, let me say that I, and you too probably, would never dream of resorting to classical diff eq's for something like this- that's because God gave us Pierre-Simon, marquis de LaPlace!
Yep. Laplace Transforms are like putting away the bone knife and picking up a chainsaw.
Very embarrassingn , nonetheless. :redface:

Ih = C1*eX1*t + C2*eX2*t

C1 and C2 are both zero, I think we all have that figured out by now, me last. C1 and C2 are associated with the initial conditions.

So we look for - what did they call it? - the complementary function or particular integral, I don't remember.

So we "guess" i(t) = Asin(wt) + Bcos(wt) & stick that into our diff eq., equate coefficients of sin and cos, and away we go. Does that sound better, gneill?

The Particular Solution will be necessary, yes, but there should still be a homogeneous solution to add to it. The complete solution is always the sum of the two. This particular problem seems to be a bugger because the initial conditions for the circuit are all zero. So there's nothing for the homogenous solution, by the usual procedure, to come to grips with. It's like saying, "here's a circuit with no charges, no currents, and no power source. What will happen?".

I finally got around that by using both the Particular Solution and the homogeneous solution together with the initial conditions to find the coefficients for the homogeneous solution. Quite a bother. It doesn't help that I'm rather rusty in the "bone knives and bearskins" approach to differential equation solving!

I took a moment to graph the resulting total solution and compared it to a spice simulation (picked suitable component values). The plots seem to match remarkably well.

Hopefully the OP will be able complete the problem in a similar manner with the hints given.
 
  • #19
I think you have it right.
Why don't they teach Laplace before doing these relatively complex networks I can't imagine.

On the other hand I have to admit loss of memory on the classical way to solve this sort of thing, not good if you're trying to help undergrads. Thanks for your posts.
 
  • #20
Teacher suggested to assume I(0) = I'(0) = 0 and use same equation Ip(0) + Ih(0) = 0 for all cases, I'll post results later, if I manage to get any.
 
  • #21
Well I've got some reason. But I don't feel they're correct. Could anyone proof-check please?

Ip=a*cos(w*t) + b*sin(w*t)
Ip' = -a*w*sin(w*t) + b*w*cos(w*t)
Ip(0) = a
Ip'(0) = b*w

Discriminant > 0
Ih = C1 * e^At + C2 * e^Bt
Ih' = C1 * A * e^At + C2 * B * e^Bt
Ih(0) = C1 + C2
Ih' = C1 * A + C2 * B
Solving Ip(0) + Ih(0) = 0 and Ip'(0) + Ih'(0) = 0 results in C2 = (b*w-a*A)/(A*B), C1 = -C2 - a

Discriminant = 0
Ih = e^Xt(C1 + C2*t)
Ih' = e^Xt(C1*X + C2 + C2*X)
Ih(0) = C1
Ih'(0) = C1*X + C2 + C2*X
Solving Ip(0) + Ih(0) = 0 and Ip'(0) + Ih'(0) = 0 results in C1 = -a, C2 = (-b*w+a*X)/(1+X)

Discriminant < 0
Ih = e^αt*cos(βt)*(C1 + C2) + e^αt*i*sin(βt)*(C1 - C2)
Defining B1 = (C1 + C2), B2 = i(C1 - C2)
Ih = B1*e^αt*cos(βt) + B2*e^αt*sin(βt)
Ih' = e^(t*α)*((B1*α + B2*β)*cos[t*β] + (B2*α - B1*β)*sin[t*β])
Ih(0) = B1
Ih'(0) = B1*α + β * B2
Solving Ip(0) + Ih(0) = 0 and Ip'(0) + Ih'(0) = 0 results in B1 = -a, B2 = (α*α - b*w)/β

Graphs of D>0 and D=0 look similar, only D<0 is different, therefore I feel it's wrong.
 
  • #22
Since gneill is obviously doing a much better job than I at handling the classical solution, I will just provide the answer from the Laplace analysis. I like to use lower case for time variables and upper case for the corresponding transformed variables:

e(t) = e0sin(ωt)
so E(s) = e0ω/(s2+ω2)
Then
I(s) = E(s)/(sL + R + 1/sC) = e0ω/[(s2+ω2)(sL+R+1/sC)] or

I(s) = s(e0C/ω)/[(1+s2/ω2)(s2LC + RCs + 1)

Let
w^2 = 1/LC
2ζ/w = RC

Then I(s) = s(e0C/ω)/[(1+s2/ω2)(1+2ζs/w+s2/w2)]

Let
ψ1 = arc tan(2ζωw/(w2-ω2)
ψ2 = -arc tan{√[(1-ζ2)]/(-ζ)} - arc tan{(2ζw2√(1-ζ2)/(ω2 + 2(ζ2)(w2 - w2)}

Let A = (e0/R)(2ζωw)/√[(ω2-w2)^2 + 4(ζ2)(ω2)(w2)]

Then i(t) = A{cos(ωt - ψ1) + [exp(-t/T)/√(1-ζ2)]sin[w√(1-ζ2)t - ψ2]}
where T = 1/wζ.

Notes:
If ω = w and R = 2ζ = 0, i = ∞. This is the case for an undamped circuit excited by its resonant frequency. If ω = w, i = e/R as expected.

The first term in i(t) is the steady-state solution, corresponding to the A and B used by the OP. (Note that cos(ωt - ψ1) = cosωtcosψ1 + sinωtsinψ1 etc).

The second term is the transient solution corresponding to the OP's C1 and C2 . The transient envelope dies down with time constant T.

Maybe gneill will check it out?
 

Related to RLC Circuit Differential Equation

1. What is an RLC circuit?

An RLC circuit is an electrical circuit that contains a resistor (R), an inductor (L), and a capacitor (C). These components are connected in series or in parallel and can be used to create a variety of electronic systems, including filters, oscillators, and amplifiers.

2. What is a differential equation?

A differential equation is a mathematical equation that describes how a variable changes over time. It involves a function and its derivatives, and can be used to model a wide range of phenomena in science and engineering.

3. How is a differential equation used to describe an RLC circuit?

In an RLC circuit, the voltage across the capacitor and the current through the inductor are related by a second-order differential equation. This equation takes into account the resistance, inductance, and capacitance values of the circuit, as well as the initial conditions.

4. What is the governing equation for an RLC circuit?

The governing equation for an RLC circuit is the second-order differential equation known as the RLC circuit differential equation. It is typically written in the form of a homogenous linear differential equation, and its solution can be found using various techniques such as Laplace transforms or solving for the characteristic equation.

5. What is the significance of the RLC circuit differential equation in science and engineering?

The RLC circuit differential equation is an important tool for analyzing and understanding RLC circuits, which are widely used in electronic systems. It allows scientists and engineers to predict the behavior of an RLC circuit, design circuits for specific purposes, and troubleshoot any issues that may arise.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
19
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
16
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
28
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
1K
  • Introductory Physics Homework Help
Replies
8
Views
279
  • Engineering and Comp Sci Homework Help
Replies
26
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
912
Back
Top