please use matlab to do it and send me the code. Show all your work. Your submis
ID: 3148853 • Letter: P
Question
please use matlab to do it and send me the code.
Show all your work. Your submission of this project should be a write up addressing each problem. If you created code to answer the question refer to the name of the code in the write up and place the code at end of the document. This project is due at 11:59pm on Dec 13th, 2017. During this project we are going to explore the use of a Runge-Kutta method with adaptive stepsize (1) Create a program that applies Runge-Kutta- Fehlberg Method with TOL-5 × 10-7 minimum stepsize 0.01 and maximum stepsize 0.25 to the following initial value program: 2 dt y(0) = 0, This program should output two vectors, t and w. t containing the ti's used and w containing the wi'S.Explanation / Answer
Here is the program for RungeKutte Method :
#include <iostream>
#include "RK_45.h"
#include "integrator.h"
using namespace std;
static double RK45__A[] = { 0.0, 1.0 / 4.0, 3.0 / 8.0, 12.0 / 13.0, 1.0, 1.0 / 2.0 };
static double RK45__C[] ={ 16.0 / 135.0, 0.0, 6656.0 / 12825.0, 28561.0 / 56430.0, -9.0 / 50.0, 2.0 / 55.0 };
static double RK45__B[] = {
1.0 / 4.0,
3.0 / 32.0, 9.0 / 32.0,
1932.0 / 2197.0, -7200.0 / 2197.0, 7296.0 / 2197.0,
439.0 / 216.0, -8.0, 3680.0 / 513.0, -845.0 / 4104.0,
-8.0 / 27.0, 2.0, -3544.0 / 2565.0, 1859.0 / 4104.0, -11.0 / 40.0
};
static const int RK45__nStage = 6;
void rk45step(DynFun dynFun, double tLow, double tUpp, double zLow[], double zUpp[], int nDim)
{
RK_STEP( dynFun, tLow, tUpp, zLow, zUpp, nDim, RK45__A, RK45__B, RK45__C, RK45__nStage);
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.