Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: newbie: explicit function works, "function object" doesn't

  • To: mathgroup at smc.vnet.net
  • Subject: [mg96234] Re: newbie: explicit function works, "function object" doesn't
  • From: Tom Roche <tlroche at gmail.com>
  • Date: Tue, 10 Feb 2009 05:48:20 -0500 (EST)
  • References: <gmp0st$c30$1@smc.vnet.net>

Daniel Lichtblau Mon, Feb 9, 2009 at 9:45 AM
> Offhand I do not know why your use of happysoln[t_] fails.

FWIW, it's modeled on the approach used in
http://reference.wolfram.com/mathematica/howto/SolveADifferentialEquation.html
(I'm definitely still @ the cut'n'paste stage.)

> You can get it to work as below, by putting everything inside the
> Manipulate.

> Manipulate[
>  theta'[0] == v0;
>  theta[0] == theta0;
>  linearPendulum = theta''[t] == -omega^2 theta[t];
>  soln = DSolve[{linearPendulum, theta'[0] == v0, theta[0] == theta0}, theta[t], t];
>  Plot[theta[t] /. First[soln], {t, -2 Pi, 2 Pi}], {{omega, 1}, 0, 5}, {{theta0, 1}, 0, 5}, {{v0, 1}, 0, 5}]

That works! though I'm wondering why the statements need to nest
inside the call to Manipulate. (I'm also assuming that First[soln] ==
soln[[1]]). Anyway, consider this solved.

Thanks, Tom Roche <Tom_Roche at pobox.com>


  • Prev by Date: Re: NMinimize Bug in Mathematica 7.0?
  • Next by Date: Re: Map[] and multiple args function
  • Previous by thread: Re: newbie: explicit function works, "function object"
  • Next by thread: Re: newbie: explicit function works, "function object" doesn't