How to solve runge kutta using implicit method
Ältere Kommentare anzeigen
hey guys I am trying to write a script using runge kutta implicit method 4th order I got the following equations
for n =2:(N-1)
k_1 = f(tout(n-1) +(0.5+(sqrt(3)/6)*h) , yout(:,n-1) + 0.25*h*k_1 + (0.25 + (sqrt(3)/6))*h * k_2);
k_2 = f(tout(n-1) +(0.5-(sqrt(3)/6)*h) , yout(:,n-1) + (0.25-(sqrt(3)/6))*h*k_1 + 0.25*h * k_2);
yout(:,n) = yout(:,n-1) + (h/2)*(k_1 + k_2);
end
but to find k_1, I need a value for k_1 and to find k_2 I need a value for k_2
how I am supposed to do it? Didn't undestrand implict method...
Antworten (2)
Sara
am 30 Mai 2014
0 Stimmen
Implicit means the equation has no analytic solution, i.e. you'll have to solve it iteratively. Meaning, you try guessing the value of your unknown, plug it into your equation and see if the right side is equal to the left side. In your case, for each iteration, you'll have to solve a system of algebraic equations. You can use fsolve for that, just rewrite your equations in k_1 and k_2 in the form f = (right side)-(left side)
1 Kommentar
Rong
am 31 Mai 2014
Kategorien
Mehr zu Runge Kutta Methods finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!