0% found this document useful (0 votes)
4 views3 pages

Documento Codigo

The document is a Pascal program that implements the Blasius method for solving a system of ordinary differential equations. It prompts the user for initial conditions and parameters, then uses a Runge-Kutta method to compute and display the results iteratively. The program continues until it reaches a specified value or the maximum number of iterations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Documento Codigo

The document is a Pascal program that implements the Blasius method for solving a system of ordinary differential equations. It prompts the user for initial conditions and parameters, then uses a Runge-Kutta method to compute and display the results iteratively. The program continues until it reaches a specified value or the maximum number of iterations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Program ecuaciones_blasius2;

Uses crt;

Var x,y,z,t:array[0..100] of real;

I,n:integer;

K11,k21,k31,k41,k12,k22,k32,k42,h,xn:real;

K13,k23,k33,k43:real;

Function fl(x:real;y:real;z:real;t:real):real;

Begin

Fl:=z;

End;
Function f2(x:real;y:real;z:real;t:real):real;

Begin

F2:=t;

End;

Function f3(x:real;y:real;z:real;t:real):real;

Begin

F3:=-0.5*y*t;

End;

Begin

Clrscr;

Write(‘Dame el primer valor (x0):’);readln(x[0]);

Write(‘Dame el primer valor (y0):’);readln(y[0]);

Write(‘Dame el primer valor (z0):’);readln(z[0]);

Write(‘Dame el primer valor (t0):’);readln(t[0]);

Write(‘Dame el valor de x hasta donde quieres integrar:’);readln(xn);


Write(‘Dame el tamaño de paso (h):’);readln(h);

I:=0;

Repeat

Begin

K11:=h*f1(x[i],y[i],z[i],t[i]);

K12:=h*f2(x[i],y[i],z[i],t[i]);

K13:=h*f3(x[i],y[i],z[i],t[i]);

K21:=h*f1(x[i]+h/2,y[i]+k11/2,z[i]+k12/2,t[i]+k13/2);

K22:=h*f2(x[i]+h/2,y[i]+k11/2,z[i]+k12/2,t[i]+k13/2);
K23:=h*f3(x[i]+h/2,y[i]+k11/2,z[i]+k12/2,t[i]+k13/2);

K31:=h*f1(x[i]+h/2,y[i]+k22/2,z[i]+k22/2,t[i]+k23/2);

K32:=h*f2(x[i]+h/2,y[i]+k22/2,z[i]+k22/2,t[i]+k23/2);

K33:=h*f3(x[i]+h/2,y[i]+k22/2,z[i]+k22/2,t[i]+k23/2);

K41:=h*f1(x[i]+h,y[i]+k31,z[i]+k32,t[i]+k33);

K42:=h*f2(x[i]+h,y[i]+k31,z[i]+k32,t[i]+k33);

K43:=h*f3(x[i]+h,y[i]+k31,z[i]+k32,t[i]+k33);

I:=i+1;

X[i]:=x[0]+h*i;

Y[i]:=y[i-1]+[k11+2*(k21+k31)+k41)/6;

Z[i]:=z[i-1]+[k12+2*(k22+k32)+k42)/6;
T[i]:=t[i-1]+[k13+2*(k23+k33)+k43)/6;
Writeln(x[i]:4:4,’’,y[i]:4:4,’’,z[i]:4:4,’’,t[i]:4:4);

End;

Until((i=100)or(x[i]=xn));

Readln;

End.

You might also like