Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» NewBlueFx TotalFX Windows-FL | 1.11 GB
Tue Dec 17, 2013 12:42 pm by titquarra

» NewBlueFx TotalFX Windows-FL | 1.11 GB
Tue Dec 17, 2013 12:42 pm by titquarra

» Celebrity.Sex.Tape.UNCUT.&.UNRATED.2012.720p.BRrip.x264.YIFY.mp4
Tue Dec 17, 2013 8:32 am by titquarra

» Maya Autodesk Personal Learning Edition 8.5
Tue Dec 17, 2013 7:47 am by titquarra

» Tuyệt Kỹ Đong Giai Chân Kinh (tuyệt Kỹ cua trai)
Thu Aug 23, 2012 5:38 am by Admin

» Tuyệt kỹ cua giai
Thu Aug 23, 2012 5:36 am by Admin

» NETCAT.........
Mon Aug 13, 2012 6:35 am by Admin

» Bảo mật CSDL bằng phương pháp mã hóa.
Tue Apr 17, 2012 10:04 pm by Admin

» Hàm mã hóa MD5 bằng JavaScript
Tue Apr 17, 2012 10:03 pm by Admin

Shopmotion


Affiliates
free forum


Phương pháp Runge-Kutta

View previous topic View next topic Go down

Phương pháp Runge-Kutta

Post  Admin on Thu Jun 09, 2011 3:01 am

//Phuong phap Runge-Kutta
#include <stdio.h>
#include <conio.h>

float f(float x,float y)
{
return x+y;
}
void main()
{
float a,b,y0;
int n;
float h;
int i;
float x***91;100***93;,y***91;100***93;;
float k1,k2,k3,k4;

clrscr();
printf("Giai phuong trinh vi phan:");
printf("\ny'=x+y");
printf("\n");

printf("\na=");
scanf("%f",&a);

printf("\nb=");
scanf("%f",&b);

printf("\ny0=");
scanf("%f",&y0);

printf("\nn=");
scanf("%d",&n);

getch();
clrscr();

printf("Bang ket qua:");
printf("\nx0=%f",a);
printf("\ty0=%f",y0);
printf("\n");

h=(b-a)/n;
x***91;0***93;=a;
y***91;0***93;=y0;

for (i=1;i<=n;i++)
{
x***91;i***93;=x***91;i-1***93;+h;
k1=h*f(x***91;i-1***93;,y***91;i-1***93;);
k2=h*f(x***91;i-1***93;+h/2,y***91;i-1***93;+k1/2);
k3=h*f(x***91;i-1***93;+h/2,y***91;i-1***93;+k2/2);
k4=h*f(x***91;i-1***93;+h,y***91;i-1***93;+k3);
y***91;i***93;=y***91;i-1***93;+(k1+2*k2+2*k3+k4)/6;

printf("\nx%d=%f",i,x***91;i***93;);
printf("\ty%d=%f",i,y***91;i***93;);
printf("\n");
}

getch();
}

Admin
Admin

Tổng số bài gửi : 782
Join date : 2009-08-15

View user profile http://hackis.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum