Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: Using NDSolve and Finding a specific Value

  • To: mathgroup at smc.vnet.net
  • Subject: [mg85369] Re: [mg85354] Using NDSolve and Finding a specific Value
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Thu, 7 Feb 2008 06:39:17 -0500 (EST)
  • Reply-to: hanlonr at cox.net

Clear[sols];

sols = i /. 
   NDSolve[{i'[t] == (1/8.516011) (-i[t] + 0.596120754), 
      i[1] == 0.219319}, i, {t, 1, 4}][[1]];

sols[3.8]

0.324902

Plot[sols[t], {t, 1, 4}]

Clear[sols];

sols = NDSolve[{i'[t] == (1/8.516011) (-i[t] + 0.596120754), 
     i[1] == 0.219319}, i, {t, 1, 4}][[1]];

i[3.8] /. sols

0.324902

Plot[i[t] /. sols, {t, 1, 4}]


Bob Hanlon

---- Tara.Ann.Lorenz at gmail.com wrote: 
> Hello.
> 
> I am having an issue related to the NDSolve function (I am using
> Version 6).  The following example illustrates the problem I am
> having:
> 
> Input:
> sols = NDSolve[{i'[t] == (1/8.516011) (-i[t] + 0.596120754),
>    i[1] == 0.219319}, i[t], {t, 1, 4}]
> 
> Output:
> {{i[t]->InterpolatingFunction[{{1.,4.}},<>][t]}}
> 
> I then would like to solve i[t] for t=3.8
> According to the Mathematica website, I should be able to enter the
> following input to receive my answer:
> 
> i[3.8]/.sols
> 
> However, my output is simply i[3.8] and not a numerical value.  What
> else can I try to get a numerical value from the interpolating
> function.
> 
> I appreciate any feedback. Thank you
> 
> 
> 



  • Prev by Date: Re: Conditional Plotting
  • Next by Date: Re: Memory and NDSolve
  • Previous by thread: Re: Using NDSolve and Finding a specific Value
  • Next by thread: Re: Using NDSolve and Finding a specific Value