,,,
..-.. (14 2011)
:
.
1. .
– 8- ( ).
:
,
– - 81, – - 81, – 88, – - 81.
:
– - =0 81, – 48, – 41,
– - =1 81, – 48, – 41.
, =const, [1]:
,
, - .
:
.
:
,
.
[1]:
:
.
:
=const.
, , .
.
, , , :
, T=(at+b)
.
:
, () :
.
:
.
:
,
.
:
.
:
, , :
:
.
, .
:
:
, , :
:
– , , , , , , , .
2. – , .
, , 3 . (), :
.
:
:
,
,
.
, :
,
,
.
- .
:
.
.
, , i- :
.
.
3. .
. .
.. , , , , , L/R=2 R/h=100. R/h=200 , - . , , R/h=300, R/h=500, R/h=1000.
, .
10 , , , . 50 , 50 100 .
, , 50 ( ASUS M51V CPU Duo T5800). , .
++:
// sopryazhenie.cpp: .
// - .
// 10 : - 0 - 10
//
#include "stdafx.h"
#include
#include
using namespace std;
// A b rezult.
void mat_on_vect(double A[8][8], double b[8], double rezult[8]){
for(int i=0;i<8;i++){
rezult[i]=0.0;
for(int k=0;k<8;k++){
rezult[i]+=A[i][k]*b[k];
}
}
}
// EXP=exp(A*delta_x)
void exponent(double A[8][8], double delta_x, double EXP[8][8]) {
//n - , m - (m<=n)
int n=100, m;
double E[8][8]={0}, TMP1[8][8], TMP2[8][8];
int i,j,k;
//E - -
E[0][0]=1.0; E[1][1]=1.0; E[2][2]=1.0; E[3][3]=1.0;
E[4][4]=1.0; E[5][5]=1.0; E[6][6]=1.0; E[7][7]=1.0;
// TMP1 -
//
for(i=0;i<8;i++) {
for(j=0;j<8;j++) {
TMP1[i][j]=E[i][j];
EXP[i][j]=E[i][j];
}
}
// EXP, 2- (m=2;m<=n)
for(m=2;m<=n;m++) {
for(i=0;i<8;i++) {
for(j=0;j<8;j++) {
TMP2[i][j]=0;
for(k=0;k<8;k++) {
//TMP2[i][j]+=TMP1[i][k]*A[k][j]*delta_x/(m-1);
TMP2[i][j]+=TMP1[i][k]*A[k][j];
}
TMP2[i][j]*=delta_x;//
TMP2[i][j]/=(m-1);//
EXP[i][j]+=TMP2[i][j];
}
}
// TMP1 - TMP2 m
if (m for(i=0;i<8;i++) { for(j=0;j<8;j++) { TMP1[i][j]=TMP2[i][j]; } } } } } // MAT_ROW // partial_vector - delta_x void mat_row_for_partial_vector(double A[8][8], double delta_x, double MAT_ROW[8][8]) { //n - MAT_ROW, m - (m<=n) int n=100, m; double E[8][8]={0}, TMP1[8][8], TMP2[8][8]; int i,j,k; //E - - MAT_ROW E[0][0]=1.0; E[1][1]=1.0; E[2][2]=1.0; E[3][3]=1.0; E[4][4]=1.0; E[5][5]=1.0; E[6][6]=1.0; E[7][7]=1.0; // TMP1 - // MAT_ROW for(i=0;i<8;i++) { for(j=0;j<8;j++) { TMP1[i][j]=E[i][j]; MAT_ROW[i][j]=E[i][j]; } } // MAT_ROW, 2- (m=2;m<=n) for(m=2;m<=n;m++) { for(i=0;i<8;i++) { for(j=0;j<8;j++) { TMP2[i][j]=0; for(k=0;k<8;k++) { TMP2[i][j]+=TMP1[i][k]*A[k][j]; } TMP2[i][j]*=delta_x; TMP2[i][j]/=m; MAT_ROW[i][j]+=TMP2[i][j]; } } // TMP1 - TMP2 m if (m for(i=0;i<8;i++) { for(j=0;j<8;j++) { TMP1[i][j]=TMP2[i][j]; } } } } } // - POWER: Y'(x)=A*Y(x)+POWER(x): void power_vector_for_partial_vector(double x, double POWER[8]){ POWER[0]=0.0; POWER[1]=0.0; POWER[2]=0.0; POWER[3]=0.0; POWER[4]=0.0; POWER[5]=0.0; POWER[6]=0.0; POWER[7]=0.0; } // vector - ( ) // : void partial_vector(double vector[8]){ for(int i=0;i<8;i++){ vector[i]=0.0; } } // vector - delta_x: void partial_vector_real(double expo_[8][8], double mat_row[8][8], double x_, double delta_x, double vector[8]){ double POWER_[8]={0};// double REZ[8]={0}; double REZ_2[8]={0}; power_vector_for_partial_vector(x_, POWER_);// POWER_ x_ mat_on_vect(mat_row, POWER_, REZ);// mat_row POWER_ REZ mat_on_vect(expo_, REZ, REZ_2);// expo_ REZ REZ_2 for(int i=0;i<8;i++){ vector[i]=REZ_2[i]*delta_x; } } // 88 int GAUSS(double AA[8*11][8*11], double bb[8*11], double x[8*11]){ double A[8*11][8*11]; double b[8*11]; for(int i=0;i<(8*11);i++){ b[i]=bb[i];// b, bb for(int j=0;j<(8*11);j++){ A[i][j]=AA[i][j];// , } } int e;// , () jj double s, t, main;// for(int jj=0;jj<((8*11)-1);jj++){// jj e=-1; s=0.0; main=A[jj][jj]; for(int i=jj;i<(8*11);i++){// , () jj if ((A[i][jj]*A[i][jj])>s) {// ( ) abs() e=i; s=A[i][jj]*A[i][jj]; } } if (e<0) { cout<<"Mistake "< } if (e>jj) {// jj. main=A[e][jj]; for(int j=0;j<(8*11);j++){// - e jj t=A[jj][j]; A[jj][j]=A[e][j]; A[e][j]=t; } t=b[jj]; b[jj]=b[e]; b[e]=t; } for(int i=(jj+1);i<(8*11);i++){// for(int j=(jj+1);j<(8*11);j++){ A[i][j]=A[i][j]-(1/main)*A[jj][j]*A[i][jj];// i>(jj+1) } b[i]=b[i]-(1/main)*b[jj]*A[i][jj]; A[i][jj]=0.0;// } }// jj x[(8*11)-1]=b[(8*11)-1]/A[(8*11)-1][(8*11)-1];// (87-) for(int i=((8*11)-2);i>=0;i--){// x[i] 86- 0- t=0; for(int j=1;j<((8*11)-i);j++){ t=t+A[i][i+j]*x[i+j]; } x[i]=(1/A[i][i])*(b[i]-t); } return 0; } int main() { int nn;// , 1- ( ) int nn_last=50;// double Moment[100+1]={0};// (), double step=0.05; //step=(L/R)/100 - - ( , .. ) double h_div_R;// h/R h_div_R=1.0/100; double c2; c2=h_div_R*h_div_R/12;// h*h/R/R/12 double nju; nju=0.3; double gamma; gamma=3.14159265359/4;// // : FILE *fp; // Open for write if( (fp = fopen( "C:/test.txt", "w" )) == NULL ) // C4996 printf( "The file 'C:/test.txt' was not openedn" ); else printf( "The file 'C:/test.txt' was openedn" ); for(nn=1;nn<=nn_last;nn++){ // , 1- ( ) double x=0.0;// - FF double expo_from_minus_step[8][8]={0};// (0-x1) double expo_from_plus_step[8][8]={0};// (x1-0) double mat_row_for_minus_expo[8][8]={0};// (0-x1) double mat_row_for_plus_expo[8][8]={0};// (x1-0) double U[4][8]={0};// 48 double u_[4]={0};// 4 double V[4][8]={0};// 48 double v_[4]={0};// 4 double Y[100+1][8]={0};// - ( ): MATRIXS*Y=VECTORS double A[8][8]={0};// double FF[8]={0};// double Y_many[8*11]={0};// Y(xi) 11- 0 ( Y(0)) 10 ( Y(x10)) double MATRIX_many[8*11][8*11]={0};// double B_many[8*11]={0};// : MATRIX_many*Y_many=B_many double Y_vspom[8]={0};// double Y_rezult[8]={0};// double nn2,nn3,nn4,nn5,nn6,nn7,nn8;// nn nn2=nn*nn; nn3=nn2*nn; nn4=nn2*nn2; nn5=nn4*nn; nn6=nn4*nn2; nn7=nn6*nn; nn8=nn4*nn4; // A[0][1]=1.0; A[1][0]=(1-nju)/2*nn2; A[1][3]=-(1+nju)/2*nn; A[1][5]=-nju; A[2][3]=1.0; A[3][1]=(1+nju)/(1-nju)*nn; A[3][2]=2*nn2/(1-nju); A[3][4]=2*nn/(1-nju); A[4][5]=1.0; A[5][6]=1.0; A[6][7]=1.0; A[7][1]=-nju/c2; A[7][2]=-nn/c2; A[7][4]=-(nn4+1/c2); A[7][6]=2*nn2; // U*Y[0]=u_ () V*Y[100]=v_ () : U[0][1]=1.0; U[0][2]=nn*nju; U[0][4]=nju; u_[0]=0.0;// T1 U[1][0]=-(1-nju)/2*nn; U[1][3]=(1-nju)/2; U[1][5]=(1-nju)*nn*c2; u_[1]=0.0;// S* U[2][4]=-nju*nn2; U[2][6]=1.0; u_[2]=0;// M1 U[3][5]=(2-nju)*nn2; U[3][7]=-1.0; u_[3]=-sin(nn*gamma)/(nn*gamma);// Q1* -gamma +gamma V[0][0]=1.0; v_[0]=0.0;// u V[1][2]=1.0; v_[1]=0.0;// v V[2][4]=1.0; v_[2]=0.0;// w V[3][5]=1.0; v_[3]=0.0;// // U*Y[0]=u_ V*Y[100]=v_ exponent(A,(-step*10),expo_from_minus_step);// ( - ) //x=0.0;// - //mat_row_for_partial_vector(A, step, mat_row_for_minus_expo); // MATRIX_many for(int i=0;i<4;i++){ for(int j=0;j<8;j++){ MATRIX_many[i][j]=U[i][j]; MATRIX_many[8*11-4+i][8*11-8+j]=V[i][j]; } B_many[i]=u_[i]; B_many[8*11-4+i]=v_[i]; } for(int kk=0;kk<(11-1);kk++){//(11-1) EXPO MATRIX_many for(int i=0;i<8;i++){ MATRIX_many[i+4+kk*8][i+kk*8]=1.0;// for(int j=0;j<8;j++){ MATRIX_many[i+4+kk*8][j+8+kk*8]=-expo_from_minus_step[i][j];// } } } // GAUSS(MATRIX_many,B_many,Y_many); // 101 - 0 100 exponent(A,step,expo_from_plus_step); for(int i=0;i<11;i++){// 10- ( 0 100) 11 for(int j=0;j<8;j++){ Y[0+i*10][j]=Y_many[j+i*8];// 11- - Y_many } } for(int i=0;i<10;i++){// 10- for(int j=0;j<8;j++){ Y_vspom[j]=Y[0+i*10][j];// i- , , i- } mat_on_vect(expo_from_plus_step, Y_vspom, Y_rezult); for(int j=0;j<8;j++){ Y[0+i*10+1][j]=Y_rezult[j];// 1- Y_vspom[j]=Y_rezult[j];// } mat_on_vect(expo_from_plus_step, Y_vspom, Y_rezult); for(int j=0;j<8;j++){ Y[0+i*10+2][j]=Y_rezult[j];// 2- Y_vspom[j]=Y_rezult[j];// } mat_on_vect(expo_from_plus_step, Y_vspom, Y_rezult); for(int j=0;j<8;j++){ Y[0+i*10+3][j]=Y_rezult[j];// 3- Y_vspom[j]=Y_rezult[j];// } mat_on_vect(expo_from_plus_step, Y_vspom, Y_rezult); for(int j=0;j<8;j++){ Y[0+i*10+4][j]=Y_rezult[j];// 4- Y_vspom[j]=Y_rezult[j];// } mat_on_vect(expo_from_plus_step, Y_vspom, Y_rezult); for(int j=0;j<8;j++){ Y[0+i*10+5][j]=Y_rezult[j];// 5- Y_vspom[j]=Y_rezult[j];// } mat_on_vect(expo_from_plus_step, Y_vspom, Y_rezult); for(int j=0;j<8;j++){ Y[0+i*10+6][j]=Y_rezult[j];// 6- Y_vspom[j]=Y_rezult[j];// } mat_on_vect(expo_from_plus_step, Y_vspom, Y_rezult); for(int j=0;j<8;j++){ Y[0+i*10+7][j]=Y_rezult[j];// 7- Y_vspom[j]=Y_rezult[j];// } mat_on_vect(expo_from_plus_step, Y_vspom, Y_rezult); for(int j=0;j<8;j++){ Y[0+i*10+8][j]=Y_rezult[j];// 8- Y_vspom[j]=Y_rezult[j];// } mat_on_vect(expo_from_plus_step, Y_vspom, Y_rezult); for(int j=0;j<8;j++){ Y[0+i*10+9][j]=Y_rezult[j];// 9- Y_vspom[j]=Y_rezult[j];// } } // for(int ii=0;ii<=100;ii++){ Moment[ii]+=Y[ii][4]*(-nju*nn2)+Y[ii][6]*1.0;// M1 [ii] //U[2][4]=-nju*nn2; U[2][6]=1.0; u_[2]=0;// M1 } }// for(int ii=0;ii<=100;ii++){ fprintf(fp,"%fn",Moment[ii]); } fclose(fp); printf( "PRESS any key to continue...n" ); _getch(); return 0; } - (1996 ) : 12 1970 ( )
: www.AlexeiVinogradov.narod.ru www.VinogradovAlexei.narod.ru www.Vinogradov-Alexei.narod.ru www.Vinogradov-Math.narod.ru
Copyright (c) 2025 Stud-Baza.ru , , , .