Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #3142 > unrolled thread

capacitor equation solution not working

Started by"J and B" <noslowski@comcast.net>
First post2011-06-17 04:09 +0000
Last post2011-06-17 09:52 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  capacitor equation solution not working "J and B" <noslowski@comcast.net> - 2011-06-17 04:09 +0000
    Re: capacitor equation solution not working "Nasser M. Abbasi" <nma@12000.org> - 2011-06-17 09:52 +0000

#3142 — capacitor equation solution not working

From"J and B" <noslowski@comcast.net>
Date2011-06-17 04:09 +0000
Subjectcapacitor equation solution not working
Message-ID<itek1d$s50$1@smc.vnet.net>
I am trying to solve a very simple circuit, one that has only a capacitor in
it.  What am I doing wrong?  The final graph should show that the capacitor
has discharged, but its staying constant.  I have current starting at t=10
and ending at t=60.  
I hope I have used the correct way to put in my code, I am using a new
computer and I having trouble with my email program.  Any advice would be
appreciated.

Thanks

My code.
I[t_]:= If[t<10||t>60,0,1]
Plot[i[t],{t,0,100}]
Eq=v'[t]==i[t]/c
c=1;
Soleq==v[t]/.NDSolve[{eq,v[0]==0},v[t],{t,0,100}],[[1]]
Plot[soleq,{t,0,100}]

[toc] | [next] | [standalone]


#3162

From"Nasser M. Abbasi" <nma@12000.org>
Date2011-06-17 09:52 +0000
Message-ID<itf84k$22m$1@smc.vnet.net>
In reply to#3142
On 6/16/2011 9:09 PM, J and B wrote:
> I am trying to solve a very simple circuit, one that has only a capacitor in
> it.  What am I doing wrong?  The final graph should show that the capacitor
> has discharged, but its staying constant.  I have current starting at t=10
> and ending at t=60.
> I hope I have used the correct way to put in my code, I am using a new
> computer and I having trouble with my email program.  Any advice would be
> appreciated.
>
> Thanks
>
> My code.
> I[t_]:= If[t<10||t>60,0,1]
> Plot[i[t],{t,0,100}]
> Eq=v'[t]==i[t]/c
> c=1;
> Soleq==v[t]/.NDSolve[{eq,v[0]==0},v[t],{t,0,100}],[[1]]
> Plot[soleq,{t,0,100}]

Mathematica is case senstive. Try this:

----------------
f[t_] := If[t < 10 || t > 60, 0, 1]
Plot[f[t], {t, 0, 100}]
eq = v'[t] == f[t]/c
c = 1;
soleq = v[t] /. First[NDSolve[{eq, v[0] == 0}, v, {t, 0, 100}]]
Plot[soleq, {t, 0, 100}]
----------------

--Nasser

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web