Instructor's Manual - Numerical Methods For Engineers p3

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

8.

9.
10.
11.
#include <stdio.h>
#include <math.h>

int main()
{
double v0=0.20943951, step=0.5, t, v1, out=0.0, y0=0.8, y1;
printf("%5c%10c%10c%c",'t','V','y',0x0A);
printf("__________________________________%c",0x0A);
printf("%5d%10g%10g %c",0,0.20943951,0.8,0x0A);
for (t=step;t<=10.0;t+=step)
{
if (y0<=1) out=0.0;
else out=3*pow(y0-1,1.5);
v1=v0+(3*sin(t)*sin(t)-out)*0.5;
v0=v1;
y1=pow(3*v1/(0.390625*3.1415926536),0.333333333);
y0=y1;
printf ("%5g%10g%10g%c",t,v1,y1,0x0A);
}
}

You might also like