Help! C programming...#include
#include
#define NT double
NT f(NT x, NT y)
{
return x+y;
}
NT rkstep (NT (*func)(NT, NT), NT x, NT y[], NT h, int n, NT *err[])
{
NT k[n], y12[n], y1[n], k12[n];
k[n]=(*func)(x,y[n]);
y12[n]=y[n]+k[n]*h/2;
k12[n]=(*func)(x,y12[n]);
y1[n]=y[n]+k12[n]*h;
*err[n]=fabs(k[n]-k12[n])*h/2;
return y1[n];
}
int main ()
{
int n;
NT x, y[n], h, *err[n], result[n];
x=1;
y[0]=10;
for (n=0;n (more...)
Runge-Kuta for solving ODE?