Raqamli texnologiyalar fakulteti


Download 216.26 Kb.
bet1/2
Sana25.01.2023
Hajmi216.26 Kb.
#1119308
  1   2
Bog'liq
Hisoblash usullari




SAMARQAND DAVLAT UNIVERSITETI
RAQAMLI TEXNOLOGIYALAR FAKULTETI
AMALIY MATEMATIKA VA INFORMATIKA YO’NALISHI
3 02-guruh talabasining

MUSTAQIL ISHI


Bajardi:__________________


Tekshirdi:________________
LABORATORIYA ISHI № 2
IKKINCHI TARTIBLI ODDIY DIFFIRENSIAL TENGLAMALAR (ODT) UCHUN CHEGARAVIY MASALALARNI CHEKLI AYIRMALAR USULI BILAN YECHISH
Chegaraviy masalani chekli ayirmalar usuli bilan yechish;
#include
#include
double p[1000], q[1000], f[1000], u[1000], v[1000], y[1000];
using namespace std;
int main() {
int n;
double a, b, c, d, d1, d2, c1, c2, m, k, l, j=0, h;
cout<<"n= "; cin>>n;
cout<<"a= "; cin>>a;
cout<<"b= "; cin>>b;
cout<<"c= "; cin>>c;
cout<<"d= "; cin>>d;
cout<<"c1= "; cin>>c1;
cout<<"d1= "; cin>>d1;
cout<<"c2= "; cin>>c2;
cout<<"d2= "; cin>>d2;
h=(a-b)/n;
for(int i=0; i<=10; i++ ){
p[i]=0.3+2*j;
q[i]=25*j+4;
f[i]=1.4;
j=j+0.1;
}
u[0]=(-c*h)/(-c1*h+c2);
v[0]=0;
k=u[0]; l=0;
for(int i=0; i<=10; i++){
u[0]=(-c*h)/(-c1*h+c2);
v[0]=0;
u[i+1]=(-f[i+1]*h*h+(1-0.5*p[i+1]*h)*u[i])/(-q[i+1]*h*h+2-(1-0.5*p[i+1]*h)*v[i]);
v[i+1]=(1+0.5*p[i+1]*h)/(-q[i+1]*h*h+2-(1-0.5*p[i+1]*h)*v[i]);
m=u[10];
}
for(int i=10; i>=0; i--){
y[10]=m;
y[i-1]=u[i-1]+v[i-1]*y[i];
}
for( int i=0; i<=10; i++){
"<<"u["<Download 216.26 Kb.
Do'stlaringiz bilan baham:
  1   2




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling