Group Abstract Group Abstract

Message Boards Message Boards

How do I solve and plot the equations for an RC circuit?

I am trying to solve the and plot the equations for an RC circuit. What I have so far is

v'[t] == (1/c)*(i[t] - v[t]/r)

Any help would be appreciated.

Thanks

POSTED BY: Jake Trexel
8 Replies
POSTED BY: Jake Trexel
Posted 12 years ago

Hi Jake,

I was mistaken when I said your equation was incorrect. That's the equation I gave for a parallel RC circuit. The only difference being you are taking i[t] as a given and you are solving for v[t]. I didn't notice that they were the same equations in different form.

I think your notebook looks great.

Kind regards,

David

POSTED BY: David Keith

Here is my program, and it matches my neuroscience book. I was missing the first line of code.

Attachments:
POSTED BY: Jake Trexel
Posted 12 years ago

Hi Jake, I think your equation is incorrect. For parallel (trivial) and series RC circuits driven by an arbitrary v[t] I get the solutions below. (Sorry about Out[4] -- this new code system seems awkward at best.)

In[1]:= parallelEq = i[t] == c v'[t] + v[t]/r

Out[1]= i[t] == v[t]/r + c Derivative[1][v][t]

In[2]:= (* trivial *)
DSolve[parallelEq, i[t], t]

Out[2]= {{i[t] -> (v[t] + c r Derivative[1][v][t])/r}}

In[3]:= seriesEq = v'[t] == r i'[t] + i[t]/c

Out[3]= Derivative[1][v][t] == i[t]/c + r Derivative[1][i][t]

In[4]:= DSolve[seriesEq, i[t], t]

Out[4]= {{i[t] -> E^(-(t/(c r))) C[1] + E^(-(t/(c r))) \!\(
\*SubsuperscriptBox[\(\[Integral]\), \(1\), \(t\)]\(\*
FractionBox[
RowBox[{
SuperscriptBox["E", 
FractionBox[
RowBox[{"K", "[", "1", "]"}], 
RowBox[{"c", " ", "r"}]]], " ", 
RowBox[{
SuperscriptBox["v", "\[Prime]",
MultilineFunction->None], "[", 
RowBox[{"K", "[", "1", "]"}], "]"}]}], "r"] \[DifferentialD]K[1]\)\)}}
POSTED BY: David Keith
Posted 12 years ago

Hi again -- I attach the notebook. It assumes we will know v[t] and want i[t] for each. Note that in the parallel case we don't need to solve a diffeq to get that. In the series case we do, and Mathematica supplies integration constants which can be used to accommodate initial conditions.

Attachments:
POSTED BY: David Keith
Posted 12 years ago
POSTED BY: Bill Simpson

Bill, this gave me more problems than I had!

POSTED BY: Jake Trexel
Posted 12 years ago

See if you can modify this

In[1]:= i[t] = 4; r = 2; c = 3;
sol = v[t] /. DSolve[{v'[t] == (1/c)*(i[t] - v[t]/r), v[0] == 0}, v[t], t]

Out[2]= {8 E^(-t/6) (-1 + E^(t/6))}

In[3]:= Plot[sol[[1]], {t, 0, 20}]

Out[3]= ...PlotSnipped...
POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard