1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Another mathematica problem

  1. Apr 24, 2005 #1
    Hello again.

    I have a solution for a simple differenttial eqn. "Simpletreb=First@NDSolve[{phi''[t] == -d
    Sin[phi[t]], phi[0] == (3π/4), phi'[0] == 0}, phi[t], {t, 0, 1}]"

    After some plots and other calculations i need to find the value for phi at t=0.224511 so i input "phi[0.224511]/.simpletreb" but this just outputs "phi[0.224511]". I've also tried "Evaluate[phi[0.224511]/.simpletreb" with no joy.

    My .nb file is here: (you have to cut and paste the link i'm afraid) "http://bruce1711.150m.com/simple trebuchet (first) final.nb"

    Any ideas anyone???
     
    Last edited: Apr 24, 2005
  2. jcsd
  3. Apr 24, 2005 #2

    saltydog

    User Avatar
    Science Advisor
    Homework Helper

    In general:

    solution=NDSolve[{y''[x]=such and such},y,{x,0,end}];

    f[x_]:=Evaulate[y[x]/.solution];

    Now, can use f[x] like any other function.
     
  4. Apr 24, 2005 #3
    Ok i tried that and i still get:
    "Evaulate[phi[0.22]]" as the answer instead of a value. :confused:
     
  5. Apr 24, 2005 #4
    Got it now thanks Saltydog. :smile:
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Another mathematica problem
  1. Mathematica Problem (Replies: 3)

  2. Mathematica problem (Replies: 4)

  3. Mathematica problem (Replies: 2)

Loading...