Internet saytları:
https://ru.m.wikipedia.org
https://portal.tpu.ru
https://coderoad.ru
Qosımshalar
(Jeke kompyuter ushın C++ tilinde dúzilgen programmalar hám
olardıń iske asırılıwınan alınǵan sanlı nátiyjelerdiń basıp
shıǵarılǵan nusxaları)
1-Koshi máselesiniń sheshimin alıw ushın 4-tártipli Runge-Kutta usılınıń C++ tilinde dúzilgen programması:
#include
#include
#include
#include
float funkciya(float,float);
using namespace std;
int main()
{
int i,n=5;
float x[100],y[100],z[100],dy[100],dz[100],h=0.1,k1,k2,k3,k4,q1,q2,q3,q4;
x[0]=1; y[0]=1; z[0]=0;
cout<<"\n\n *** II- TÁRTIPLI Á.D.T LAR USHIN QOYILG'AN ***\n";
cout<<"***KOSHI MÁSELESIN RUNGE-KUTTA USILI MENEN SHESHIW *\n\n";
cout<<" ÉÍÍËÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n";
cout<<" º iº xi º yi º k=h*fi º ^yi º Q º\n";
cout<<" ÌÍÍÎÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍ͹\n";
for(i=0;i<=n;i++)
{
if(i!=n)
{
cout<<" º"; if(i<5) cout<<" ";
cout<cout<<"º "<cout<<" º "<cout<<"º "; cout<0) cout<<" ";
cout<<"º "<<" º º\n º º ";
q2=U_funkciya(x[i]+h/2,y[i]+k1*h/2,z[i]+q1*h/2); k2=V_funkciya(z[i]+ q1*h/2);
cout<cout<if(k2>0) cout<<" "; cout<<"º º º\n º º ";
q3=U_funkciya(x[i]+h/2,y[i]+k2*h/2,z[i]+q2*h/2); k3=V_funkciya(z[i]+q2*h/2);
cout<cout<if(k3>0) cout<<" "; cout<<"º º º\n º º ";
q4=U_funkciya(x[i]+h,y[i]+k3*h, z[i]+q3*h)); k4=V_funkciya(z[i]+q3*h);
dy[i]=h*(k1+2*k2+2*k3+k4)/6;
cout<if(y[i]+k3<10) cout<<" "; cout<<"º "<if(k4>0) cout<<" "; cout<<"º "<0) cout<<" ";
cout<<"º "<y[i+1]=y[i]+dy[i]; x[i+1]=x[i]+h;
cout<<"ÌÍÍÎÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍ͹\n";
}
else
{
cout<<" º"; if(i<10) cout<<" ";
cout<cout<cout<<" º º º º\n ";
}
}
cout<<"ÈÍÍÊÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n";
getch();
return 0;
}
float U_funkciya(float x1,float y1, float z1)
{
float y2;
y2=4*x1-2*y1-2*x1*z1;
return y2;
}
float V_funkciya(float z1)
{
float z2;
z2=z1;
return z2; }
*** II- TÁRTIPLI Á.D.T LAR USHIN QOYILG'AN ***
*** KOSHI MÁSELESIN RUNGE-KUTTA USILI MENEN SHESHIW ***
╔══╦══════╦═════════╦═════════╦══════════╦══════════╦══════════╗
║ i║ xi ║ yi ║ zi ║ k ║ q ║ ^yi ║
╠══╬══════╬═════════╬═════════╬══════════╬══════════╬══════════╣
║ 0║ 0.00 ║ 1.0000 ║ 0.0000 ║ 0.0000 ║ -2.0000 ║ 0.0000 ║
║ ║ 0.05 ║ 1.0000 ║ -0.1000 ║ -0.1000 ║ -1.7900 ║ -0.2000 ║
║ ║ 0.05 ║ 0.9950 ║ -0.0895 ║ -0.0895 ║ -1.7811 ║ -0.1790 ║
║ ║ 0.10 ║ 1.0995 ║ -0.1781 ║ -0.1781 ║ -1.5465 ║ -0.1781 ║
╠══╬══════╬═════════╬═════════╬══════════╬══════════╬══════════╣
║ 1║ 0.10 ║ 0.9907 ║ -0.1781 ║ -0.1781 ║ -1.5458 ║ -0.1781 ║
║ ║ 0.15 ║ 0.9818 ║ -0.2554 ║ -0.2554 ║ -1.2870 ║ -0.5109 ║
║ ║ 0.15 ║ 0.9779 ║ -0.2425 ║ -0.2425 ║ -1.2831 ║ -0.4850 ║
║ ║ 0.20 ║ 0.9665 ║ -0.3065 ║ -0.3065 ║ -1.0103 ║ -0.3065 ║
╠══╬══════╬═════════╬═════════╬══════════╬══════════╬══════════╣
║ 2║ 0.20 ║ 0.9660 ║ -0.3064 ║ -0.3064 ║ 5.0690 ║ -0.3064 ║
║ ║ 0.25 ║ 0.9507 ║ -0.0530 ║ -0.0530 ║ -0.8750 ║ -0.1059 ║
║ ║ 0.25 ║ 0.9634 ║ -0.3502 ║ -0.3502 ║ -0.7517 ║ -0.7003 ║
║ ║ 0.30 ║ 0.9310 ║ -0.3816 ║ -0.3816 ║ -0.4331 ║ -0.3816 ║
╠══╬══════╬═════════╬═════════╬══════════╬══════════╬══════════╣
║ 3║ 0.30 ║ 0.9411 ║ -0.2834 ║ -0.2834 ║ 4.8647 ║ -0.2834 ║
║ ║ 0.35 ║ 0.9270 ║ -0.0401 ║ -0.0401 ║ -0.4258 ║ -0.0803 ║
║ ║ 0.35 ║ 0.9391 ║ -0.3047 ║ -0.3047 ║ -0.2650 ║ -0.6093 ║
║ ║ 0.40 ║ 0.9107 ║ -0.3099 ║ -0.3099 ║ -0.0266 ║ -0.3099 ║
╠══╬══════╬═════════╬═════════╬══════════╬══════════╬══════════╣
║ 4║ 0.40 ║ 0.9198 ║ -0.2249 ║ -0.2249 ║ 4.5425 ║ -0.2249 ║
║ ║ 0.45 ║ 0.9085 ║ 0.0022 ║ 0.0022 ║ -0.0190 ║ 0.0045 ║
║ ║ 0.45 ║ 0.9199 ║ -0.2258 ║ -0.2258 ║ -0.1635 ║ -0.4517 ║
║ ║ 0.50 ║ 0.8972 ║ -0.2085 ║ -0.2085 ║ -0.4142 ║ -0.2085 ║
╠══╬══════╬═════════╬═════════╬══════════╬══════════╬══════════╣
║ 5║ 0.50 ║ 0.9051 ║ -0.1375 ║ -0.1375 ║ 4.1440 ║ ║
╚══╩══════╩═════════╩═════════╩══════════╩══════════╩══════════╝
2-Koshi máselesiniń sheshimin alıw ushın 4-tártipli Runge-Kutta usılınıń C++ tilinde dúzilgen programması:
#include
#include
#include
#include
float funkciya(float,float);
using namespace std;
int main()
{
int i,n=5;
float x[100],y[100],z[100],dy[100],dz[100],h=0.1,k1,k2,k3,k4,q1,q2,q3,q4;
x[0]=0; y[0]=0; z[0]=1;
cout<<"\n\n *** II- TÁRTIPLI Á.D.T LAR USHIN QOYILG'AN ***\n";
cout<<"***KOSHI MÁSELESIN RUNGE-KUTTA USILI MENEN SHESHIW *\n\n";
cout<<" ÉÍÍËÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»\n";
cout<<" º iº xi º yi º k=h*fi º ^yi º Q º\n";
cout<<" ÌÍÍÎÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍ͹\n";
for(i=0;i<=n;i++)
{
if(i!=n)
{
cout<<" º"; if(i<5) cout<<" ";
cout<cout<<"º "<cout<<" º "<cout<<"º "; cout<0) cout<<" ";
cout<<"º "<<" º º\n º º ";
q2=U_funkciya(x[i]+h/2,y[i]+k1*h/2,z[i]+q1*h/2); k2=V_funkciya(z[i]+ q1*h/2);
cout<cout<if(k2>0) cout<<" "; cout<<"º º º\n º º ";
q3=U_funkciya(x[i]+h/2,y[i]+k2*h/2,z[i]+q2*h/2); k3=V_funkciya(z[i]+q2*h/2);
cout<cout<if(k3>0) cout<<" "; cout<<"º º º\n º º ";
q4=U_funkciya(x[i]+h,y[i]+k3*h, z[i]+q3*h)); k4=V_funkciya(z[i]+q3*h);
dy[i]=h*(k1+2*k2+2*k3+k4)/6;
cout<if(y[i]+k3<10) cout<<" "; cout<<"º "<if(k4>0) cout<<" "; cout<<"º "<0) cout<<" ";
cout<<"º "<y[i+1]=y[i]+dy[i]; x[i+1]=x[i]+h;
cout<<"ÌÍÍÎÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍ͹\n";
}
else
{
cout<<" º"; if(i<10) cout<<" ";
cout<cout<cout<<" º º º º\n ";
}
}
cout<<"ÈÍÍÊÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍͼ\n";
getch();
return 0;
}
float U_funkciya(float x1,float y1, float z1)
{
float y2;
y2=-2*y1-2*x1*z1;
return y2;
}
float V_funkciya(float z1)
{
float z2;
z2=z1;
return z2; }
*** II- TÁRTIPLI Á.D.T LAR USHIN QOYILG'AN ***
*** KOSHI MÁSELESIN RUNGE-KUTTA USILI MENEN SHESHIW ***
╔══╦══════╦═════════╦═════════╦══════════╦══════════╦══════════╗
║ i║ xi ║ yi ║ zi ║ k ║ q ║ ^yi ║
╠══╬══════╬═════════╬═════════╬══════════╬══════════╬══════════╣
║ 0║ 0.00 ║ 0.0000 ║ 1.0000 ║ 1.0000 ║ 0.0000 ║ 1.0000 ║
║ ║ 0.05 ║ 0.0500 ║ 1.0000 ║ 1.0000 ║ -0.2000 ║ 2.0000 ║
║ ║ 0.05 ║ 0.0500 ║ 0.9900 ║ 0.9900 ║ -0.1990 ║ 1.9800 ║
║ ║ 0.10 ║ 0.0500 ║ 0.9801 ║ 0.9801 ║ -0.3940 ║ 0.9801 ║
╠══╬══════╬═════════╬═════════╬══════════╬══════════╬══════════╣
║ 1║ 0.10 ║ 0.0993 ║ 0.9801 ║ 0.9801 ║ -0.3947 ║ 0.9801 ║
║ ║ 0.15 ║ 0.1483 ║ 0.9604 ║ 0.9804 ║ -0.5848 ║ 1.9208 ║
║ ║ 0.15 ║ 0.1474 ║ 0.9509 ║ 0.9509 ║ -0.5800 ║ 1.9018 ║
║ ║ 0.20 ║ 0.1944 ║ 0.9221 ║ 0.9221 ║ -0.7577 ║ 0.9221 ║
╠══╬══════╬═════════╬═════════╬══════════╬══════════╬══════════╣
║ 2║ 0.20 ║ 0.1947 ║ 0.9221 ║ 0.9221 ║ -2.2034 ║ 0.9221 ║
║ ║ 0.25 ║ 0.2409 ║ 0.8119 ║ 0.8119 ║ -0.8877 ║ 1.6239 ║
║ ║ 0.25 ║ 0.2353 ║ 0.8777 ║ 0.8777 ║ -0.9095 ║ 1.7554 ║
║ ║ 0.30 ║ 0.2825 ║ 0.8311 ║ 0.8311 ║ -1.0637 ║ 0.8311 ║
╠══╬══════╬═════════╬═════════╬══════════╬══════════╬══════════╣
║ 3║ 0.30 ║ 0.2803 ║ 0.8077 ║ 0.8077 ║ -2.0683 ║ 0.8077 ║
║ ║ 0.35 ║ 0.3207 ║ 0.7043 ║ 0.7043 ║ -1.1344 ║ 1.4087 ║
║ ║ 0.35 ║ 0.3155 ║ 0.7510 ║ 0.7510 ║ -1.1567 ║ 1.5020 ║
║ ║ 0.40 ║ 0.3554 ║ 0.6921 ║ 0.6921 ║ -1.2644 ║ 0.6921 ║
╠══╬══════╬═════════╬═════════╬══════════╬══════════╬══════════╣
║ 4║ 0.40 ║ 0.3538 ║ 0.6758 ║ 0.6758 ║ -1.8299 ║ 0.6758 ║
║ ║ 0.45 ║ 0.3876 ║ 0.5843 ║ 0.5843 ║ -1.3011 ║ 1.1687 ║
║ ║ 0.45 ║ 0.3830 ║ 0.6108 ║ 0.6108 ║ -1.3157 ║ 1.2215 ║
║ ║ 0.50 ║ 0.4149 ║ 0.5443 ║ 0.5443 ║ -1.3740 ║ 0.5443 ║
╠══╬══════╬═════════╬═════════╬══════════╬══════════╬══════════╣
║ 5║ 0.50 ║ 0.4140 ║ 0.5352 ║ 0.5352 ║ -1.5135 ║ ║
╚══╩══════╩═════════╩═════════╩══════════╩══════════╩══════════╝
Do'stlaringiz bilan baham: |