Runga-Kutta help needed (Matlab)

  • MATLAB
  • Thread starter Mech-Master
  • Start date
  • Tags
    Matlab
In summary, the conversation discusses an object of mass m falling from rest near Earth's surface with air resistance proportional to velocity. The differential equation for velocity as a function of time is m*dv/dt = mg - cv^2. The exact solution is v = sqrt(m*g/c)*tanh(t*sqrt(g*c/m)). For given parameters, the exact and numerical solutions are plotted using Runge-Kutta methods. Assistance may be needed for coding the method, but Matlab already has a built-in solver.
  • #1
Mech-Master
13
0
An object of mass m falls from rest at a point near the Earth's surface. If the air resistance is proportional to the velocity v^2, the differential equation for the velocity as a function of time is given by:

m*dv/dt = mg - cv^2

a) Derive the exact solution

done this part, and i got v = sqrt(m*g/c)*tanh(t*sqrt(g*c/m))

b) For the given paraments g = 9.81 m/s^2. m = 68.1 kg and c = 1.5 kg/m. plot the exact solution and the numerical solution v(t) obtained from the 4th order predictor-corrector runge kutta methods using an interval of dt = 0.25 seconds in the domain of 0<t<6

i'm having trouble coding the runge kutta method with all the k1, k2, k3 and k4.. I really need help with this.

Thanks
 
Physics news on Phys.org
  • #2
Matlab already has a built-in Runge-Kutta solver, probabaly ode45. So I think you need not have to worry about those ki's.
 

1. What is Runga-Kutta method in Matlab?

The Runga-Kutta method is a numerical method used to solve ordinary differential equations (ODEs) in Matlab. It is an iterative process that uses a series of approximation formulas to find the solution to the ODE at different time steps.

2. How accurate is Runga-Kutta method in Matlab?

The accuracy of the Runga-Kutta method in Matlab depends on the order of the method used. Higher order methods, such as the 4th order Runga-Kutta method, are generally more accurate than lower order methods. However, the accuracy also depends on the step size used and the complexity of the ODE being solved.

3. How do I implement Runga-Kutta method in Matlab?

In Matlab, the Runga-Kutta method can be implemented using the ode45 function. This function takes in the ODE, initial conditions, and other parameters as inputs and returns the solution as a vector. Alternatively, the Runga-Kutta method can also be implemented manually by following the iterative process using the appropriate formulas.

4. What are the advantages of using Runga-Kutta method in Matlab?

The Runga-Kutta method is a versatile and robust method for solving ODEs in Matlab. It can handle a wide range of ODEs, including stiff and non-stiff systems. Additionally, the method is highly accurate and requires minimal computational resources, making it a popular choice among scientists and engineers.

5. Are there any limitations to using Runga-Kutta method in Matlab?

While the Runga-Kutta method is generally a reliable method for solving ODEs in Matlab, it does have some limitations. For example, it may not be suitable for solving ODEs with discontinuities or singularities. Additionally, the method may not be the most efficient for solving certain types of ODEs, such as those with very small or very large values.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
Replies
60
Views
738
  • Programming and Computer Science
Replies
15
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
  • Introductory Physics Homework Help
Replies
6
Views
328
Back
Top