CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   2N Storage Runge kutta-part2 (https://www.cfd-online.com/Forums/main/9646-2n-storage-runge-kutta-part2.html)

vasanth August 5, 2005 09:45

2N Storage Runge kutta-part2
 
Hi ,

Last time, I asked how to derive the order equations for 2N storage.Thanks to "Runge_Kutta",who showed me the way.I derived the order equations but they are horribly nonlinear.Even Maple can hardly solve more than 7 equations at one time.Is there any other software(for solvong nonlinear-sys of equations) that can make life easy.

Thank you all Vasanth

Runge_Kutta August 6, 2005 13:16

Re: 2N Storage Runge kutta-part2
 
If you are trying to solve low-storage schemes that remove many degrees of freedom from the ERK or you have a bunch of stages, skip the symbolic manipulators and go straight to a nonlinear equation solver. If, on the other hand, you want to solve for full storage methods, use the symbolic manipulator. What follows is for the latter scenario. First, write the ERK method in terms of vectors and matrices like this below (Mathematica). For an example, lets solve for the general solution of the 4-stage, 4th-order ERK with c2 and c3 being the 2 unused degrees of freedom (see Butcher's 1987 book, p197). The "classic Runge-Kutta" is a special case of this solution for c2 = 1/2 and c3 = 1.

b = {b1,b2,b3,b4}; c = {0,c2,c3,c4}; e = {1,1,1,1}; a = {{0,0,0,0}, {a21,0,0,0}, {a31,a32,0,0}, {a41,a42,a43,0}};

(* Row-Sum condition *)

ae = a.e; ans = Solve[{ae[[2]]==c2,ae[[3]]==c3,ae[[4]]==c4},{a21,a31,a41}]; a21 = Simplify[Part[a21 /. ans, 1]]; a31 = Simplify[Part[a31 /. ans, 1]]; a41 = Simplify[Part[a41 /. ans, 1]];

(* Quadrature Order conditions *)

t11 = Simplify[ b.e - 1/1!]; t21 = Simplify[ b.c - 1/2!]; t31 = Simplify[ b.c^2/2! - 1/3!]; t41 = Simplify[ b.c^3/3! - 1/4!];

ans = Solve[{t11==0,t21==0,t31==0,t41==0},{b1,b2,b3,b4}]; b1 = Simplify[Part[b1 /. ans, 1]]; b2 = Simplify[Part[b2 /. ans, 1]]; b3 = Simplify[Part[b3 /. ans, 1]]; b4 = Simplify[Part[b4 /. ans, 1]];

(* Other Order conditions *)

t32 = b.a.c - 1/3!; t42 = (b*c).a.c - 3/4!; t43 = b.a.c^2/2 - 1/4!; t44 = b.a.a.c - 1/4!;

ans = Solve[{t32==0,t42==0,t43==0},{a32,a42,a43}]; a32 = Simplify[Part[a32 /. ans, 1]]; a42 = Simplify[Part[a42 /. ans, 1]]; a43 = Simplify[Part[a43 /. ans, 1]];

ans = Solve[{t44==0},{c4}]; c4 = Simplify[Part[c4 /. ans, 1]];

a = Simplify[ a ] b = Simplify[ b ] c = Simplify[ c ]

This can be written more effectively but that is not the point here. The key is knowing how to slice through these nonlinear equations. If you're good at it then you can solve for lots of methods. If you're not, you get nothing.


All times are GMT -4. The time now is 13:30.