### RK4 implementation

Posted:

**Sat Feb 29, 2020 12:00 am**Dear all,

I have written MATLAB code to simulate wind turbine. I have considered only one mode (fore-aft) of tower and verified results with FAST simulation results. They are agreeing reasonably well. In this case I have used RK4 numerical integration in both MATLAB and FAST with a time step of 0.05 sec. To improve fidelity of MATLAB model, I have included second bending mode (fore-aft) of the tower also. Now, if i use the same integrator settings (RK4, stepsize 0.05) tower top displacement results are blowing up (to 10^200). In order to get meaningful results I had to reduce step size to 0.0001s but the results are meaningful but the computation time is prohibitively high (in days). But FAST is able to give meaningful results even with 0.01s timestep (RK4) even the time taken by FAST is much less (~ Hour). I am trying to understand the reason for this.

My question is, RK4 require to make 4 computations (K1, K2, K3 and K4) to move one step in time, right? Does FAST compute induction factors at all the 4 intermediate steps? Or does it do some sort of an interpolation? Because this is makes significant difference to the computational time (Approx ~0.08s for induction factor computation of at all airfoils at one time step). In my computations, I calculate induction factor at all the 4 intermediate steps. This makes my code significantly slower.

I have written MATLAB code to simulate wind turbine. I have considered only one mode (fore-aft) of tower and verified results with FAST simulation results. They are agreeing reasonably well. In this case I have used RK4 numerical integration in both MATLAB and FAST with a time step of 0.05 sec. To improve fidelity of MATLAB model, I have included second bending mode (fore-aft) of the tower also. Now, if i use the same integrator settings (RK4, stepsize 0.05) tower top displacement results are blowing up (to 10^200). In order to get meaningful results I had to reduce step size to 0.0001s but the results are meaningful but the computation time is prohibitively high (in days). But FAST is able to give meaningful results even with 0.01s timestep (RK4) even the time taken by FAST is much less (~ Hour). I am trying to understand the reason for this.

My question is, RK4 require to make 4 computations (K1, K2, K3 and K4) to move one step in time, right? Does FAST compute induction factors at all the 4 intermediate steps? Or does it do some sort of an interpolation? Because this is makes significant difference to the computational time (Approx ~0.08s for induction factor computation of at all airfoils at one time step). In my computations, I calculate induction factor at all the 4 intermediate steps. This makes my code significantly slower.