Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

MATLAB Solving ODE in matlab

  1. Jun 17, 2009 #1
    d(B^2W)/dx = BW

    d(B^2W^2)/dx = (W(1-x)^1/n)^-1

    more details are found in the attached file

    I have a problem and need serious help using runge-kutta in matlab to solve ode

    please find attached the problem.

    I would appreciate it if someone helps me out


    Attached Files:

    Last edited: Jun 17, 2009
  2. jcsd
  3. Jun 17, 2009 #2
    Try ode45. In console, type
    Code (Text):

    help ode45
  4. Jun 17, 2009 #3
    Thanks AiRAVATA.

    I have already tried that but I get half of my answers to be equal to the solution and the rest having a difference between +1 and +1.5.
  5. Jun 17, 2009 #4
    I don't understand. Can you elaborate?
  6. Jun 18, 2009 #5
    Use simulink and treat your X variable as time. Then you can use whatever complicated function you want to update. Compute the derivatives and integrate once. Then supply the result as the new X variable to the system.

    I hate SIMULINK anyway. But very convenient for such things. Oh by the way, choose a fixed step solver in simulation parameters.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook