Re: Plot using DSolve HELP
- To: mathgroup at smc.vnet.net
- Subject: [mg104412] Re: Plot using DSolve HELP
- From: Peter Breitfeld <phbrf at t-online.de>
- Date: Sat, 31 Oct 2009 01:49:33 -0500 (EST)
- References: <hce3uu$r15$1@smc.vnet.net>
"Becky" wrote:
> I have a problem with what I am showing below.
>
> Step one is my equation.
> eq = i * v[t]/r +c v'[t]
>
> Step two I want to solve it, using DSolve, and put my values in as shown.
> Please note, that "i= 0", and my IC is v[0]== -70.
>
> sol=v[t]/.DSolve[{eq/.{c->3, i->0, r->2.5} ,v[0]==-70}, v[t], t]
> {-70 *-0.133333 t}
> The results are shown above.
>
> Thus next step is to plot it.
> p1=Plot[sol,{t,-20,140}]
>
> My problem is that I get a line from -70 on the vertical axis going in a
> curve up to the horizontal axis out to 140. The vertical axis is "v" and
> the horizontal is "t".
>
> What am I doing wrong?
I don't get your result. First, eq is not an equation, maybe you meant
eq1= i* v[t]/r+c v'[t]==0
If you set i->0, eq reduces to v[t]==const, so v[t]=v[0]=-70
The general solution is
DSolve[{eq1,v[0]==-70},v[t],t]
Out= {-70 Exp[-i t/(c r)]}
--
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de