How Do You Solve ODEs with Runge-Kutta in MATLAB?

  • Context: MATLAB 
  • Thread starter Thread starter lordtozo
  • Start date Start date
  • Tags Tags
    Matlab Ode
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
4 replies · 5K views
lordtozo
Messages
2
Reaction score
0
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

Thanks
 

Attachments

Last edited:
Physics news on Phys.org
Try ode45. In console, type
Code:
help ode45
 
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.
 
I don't understand. Can you elaborate?
 
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.