# Circuit differential Equation

1. Apr 10, 2013

### dinospamoni

1. The problem statement, all variables and given/known data

The power supply in the circuit shown has V(t) = (120V)cos(ωt), where ω = 310 rad/s. Determine the current ﬂowing through the resistor at time t = 9.7 s, given R = 600 Ω, C = 18 mF, and I(0) = 0 A. As a reminder, Kirkhoﬀ’s voltage law for this circuit (Eq. 8-1.3 in the book) reduces to: dV/dt = R(dI/dt) + I/C.

2. Relevant equations

3. The attempt at a solution

I've tried this about ten times and can't seem to get the right answer:

I found dV/dt = -37200 Sin(wt) (i'll call it v' from now on)

Rearranging the equation to make it in standard form:

dI/dt + (1/RC)I = v'/R

P= 1/RC = .0926

Q=v'/R = -62 Sin(wt)

F = ∫p dt

So e^F = e^.0926 t
and e^-F = e^-.0926 t

This equation was given in class for solving this type of DE:

I = (e^-I)∫Q*e^F dt + c1*e^-F

When plug this into mathematica, it gives me an imaginary answer

Any ideas?

Last edited by a moderator: Apr 12, 2013
2. Apr 10, 2013

### cepheid

Staff Emeritus
So you have a linear, first-order, inhomogeneous differential equation for i(t):$$i^\prime + \frac{1}{RC}i = f(t)$$where f(t) is some function of time, in this case given by $v^\prime(t)/R$

The typical way to solve this type of ODE is by the Method of Integrating Factors. This method works as follows. If you multiply both sides of the equation by exp( w(t) dt), where w(t) is the coefficient on the i(t) term, you can turn the left-hand side (LHS) of the equation into an exact differential, where an exact differential is just "something that is the derivative of something else." Once your LHS is just a derivative, you can solve the equation by direct integration w.r.t. time. In this case, w(t) = 1/RC, and so the factor by which you'd be multiplying things would just be exp(dt/RC) = exp(t/RC). That gives us this:$$i^\prime e^{t/RC} + i \frac{1}{RC}e^{t/RC} = e^{t/RC}f(t)$$If you look closely at the LHS, you can see that it looks like something that has already been differentiated using the chain rule.. So, you can "reverse" this differentiation to produce the following:$$\frac{d}{dt}\left[i(t)e^{t/RC}\right] = e^{t/RC}f(t)$$(You can easily verify that taking the derivative of the thing in square brackets will reproduce the LHS of the previous equation). So, now you can solve for i(t) by integrating both sides w.r.t. time (since f(t) is a known function). You'll also have to apply the initial conditions. Can you take it from here?

3. Apr 10, 2013

### dinospamoni

That worked beautifully. This is how I was used to doing these, but I figured I'd try my professor's way. Not sure where it went wrong. But thanks!

4. Apr 12, 2013

### vela

Staff Emeritus
Your professor is using the method of integrating factors as well. You should be able to figure out that the first exponential should be $e^{-F}$.

My guess is you entered something like Exp[-I] into Mathematica. In Mathematica, "I" stands for $i$, which is why you're getting a complex answer.