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!

Confusion, matlab, ode45 variables.

  1. Apr 22, 2011 #1
    1. The problem statement, all variables and given/known data

    I am very confused over how matlab knows which variables are changeable variables in ode45.

    2. Relevant equations // 3. The attempt at a solution

    My input is p

    Earlier have defined;
    a = 1;
    k = 1;
    w = 1/3;

    Then I want to figure out adot and adoubledot from these.

    adot = (a)*(p - k/a)^(-1/2);

    adoubledot = (a/2)*(p + 3*w*p);

    Suddenly realised that I have no idea why matlab would let "a" change but not let "p" and "k" change...

    Is there a way to tell matlab that one of the variables is changing in time and the others aren't?
  2. jcsd
  3. Apr 23, 2011 #2
    Nobody? =( Does my question make sense?
  4. Apr 23, 2011 #3


    User Avatar
    Gold Member

    I'm not sure exactly what you're asking. For ode45 you need to define a function. Ode45 uses the function definition for variables. (I think you need to have only one variable For ode45, so if you have more than one you can use a column vector.)
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?

Similar Discussions: Confusion, matlab, ode45 variables.
  1. Matlab: ode45 help (Replies: 1)

  2. Matlab ode45 Problem (Replies: 5)