MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Manipulate a NDSolve equation is it possible

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105602] Re: Manipulate a NDSolve equation is it possible
  • From: Albert Retey <awnl at gmx-topmail.de>
  • Date: Thu, 10 Dec 2009 04:59:27 -0500 (EST)
  • References: <hfnv37$gg4$1@smc.vnet.net>

Hi,

> Can the following be made interactive?  I would like my students to see
> there results quickly when changing certain values such as the resistance
> and capacitance.

sure it can. This is one simple possibility:


i[t_] := If[t < 10 || t > 60, 0, 1];

RCSoln[R_, c_:1, v0_:-70] :=
 NDSolve[{v'[t] == 1/c (i[t] - v[t]/R), v[0] == v0}, v, {t, 0, 100}]

Manipulate[
 Plot[Evaluate[v[t] /. RCSoln[r, c, v0]], {t, 0, 100},
  PlotRange -> {{0, 100}, {-80, 10}}, PlotStyle -> {Blue, Thick},
  Frame -> True],
 {r, 0.1, 10},
 {c, 0.1, 10},
 {v0, -80, -50}
 ]


hth,

albert


  • Prev by Date: Re: putting a label within a frame edge
  • Next by Date: Re: Manipulate a NDSolve equation is it possible
  • Previous by thread: Manipulate a NDSolve equation is it possible
  • Next by thread: Re: Re: Manipulate a NDSolve equation is it possible