请大虾们帮助做一下 谢谢!!
用ODE45 解微分方程组方程如下:
Lij*Qi’’+(1/Ck)*(Qi-Qj)=0
Pij* Qj-(1/Ck)* Qi=AV(t)
系数如下:
Lij=[0.00076606 0.00059330 0.00059316 0.00059306 0.00059296 0.00047020 0.00047022 0.00047022 0.00047022 0.00047022 0.00027481 0.00027480 0.00027481 0.00027480 0.00027480 0.00014908 0.00014907 0.00014907 0.00014907 0.00014907
0.00059330 0.00077117 0.00059317 0.00059305 0.00059296 0.00047020 0.00047020 0.00047021 0.00047021 0.00047021 0.00027480 0.00027481 0.00027480 0.00027481 0.00027480 0.00014907 0.00014907 0.00014907 0.00014907 0.00014907
0.00059316 0.00059317 0.00077633 0.00059300 0.00059304 0.00047019 0.00046930 0.00047020 0.00047023 0.00047020 0.00027479 0.00027480 0.00027479 0.00027480 0.00027479 0.00014907 0.00014907 0.00014906 0.00014907 0.00014907
0.00059306 0.00059305 0.00059300 0.00078155 0.00059307 0.00047020 0.00047022 0.00047023 0.00047022 0.00047022 0.00027407 0.00027480 0.00027480 0.00027478 0.00027479 0.00014906 0.00014907 0.00014907 0.00014907 0.00014907
0.00059296 0.00059296 0.00059304 0.00059307 0.00078682 0.00047021 0.00047021 0.00047023 0.00047022 0.00047022 0.00027480 0.00027480 0.00027480 0.00027479 0.00027479 0.00014906 0.00014906 0.00014907 0.00014907 0.00014907
0.00047020 0.00047020 0.00047019 0.00047020 0.00047021 0.00090819 0.00073048 0.00073039 0.00073038 0.00073039 0.00056883 0.00056883 0.00056883 0.00056882 0.00056880 0.00027479 0.00027478 0.00027479 0.00027480 0.00027480
0.00047022 0.00047020 0.00046930 0.00047022 0.00047021 0.00073048 0.00091551 0.00073051 0.00073047 0.00073049 0.00056883 0.00056884 0.00056883 0.00056881 0.00056882 0.00027479 0.00027479 0.00027480 0.00027479 0.00027480
0.00047022 0.00047021 0.00047020 0.00047023 0.00047023 0.00073039 0.00073051 0.00092260 0.00073060 0.00073059 0.00056884 0.00056884 0.00056884 0.00056883 0.00056882 0.00027480 0.00027480 0.00027480 0.00027480 0.00027481
0.00047022 0.00047021 0.00047023 0.00047022 0.00047022 0.00073038 0.00073047 0.00073060 0.00091717 0.00073026 0.00056885 0.00056884 0.00056884 0.00056884 0.00056882 0.00027480 0.00027479 0.00027481 0.00027481 0.00027480
0.00047022 0.00047021 0.00047020 0.00047022 0.00047022 0.00073039 0.00073049 0.00073059 0.00073026 0.00091181 0.00056886 0.00056883 0.00056884 0.00056883 0.00056883 0.00027480 0.00027480 0.00027481 0.00027480 0.00027481
0.00027481 0.00027480 0.00027479 0.00027407 0.00027480 0.00056883 0.00056883 0.00056884 0.00056885 0.00056886 0.00091181 0.00073026 0.00073046 0.00073035 0.00073027 0.00047022 0.00047022 0.00047020 0.00047021 0.00047022
0.00027480 0.00027481 0.00027480 0.00027480 0.00027480 0.00056883 0.00056884 0.00056884 0.00056884 0.00056883 0.00073026 0.00091717 0.00073060 0.00073047 0.00073038 0.00047022 0.00047022 0.00047023 0.00047021 0.00047022
0.00027481 0.00027480 0.00027479 0.00027480 0.00027480 0.00056883 0.00056883 0.00056884 0.00056884 0.00056884 0.00073046 0.00073060 0.00092260 0.00073051 0.00073039 0.00047023 0.00047023 0.00047020 0.00047021 0.00047022
0.00027480 0.00027481 0.00027480 0.00027478 0.00027479 0.00056882 0.00056881 0.00056883 0.00056884 0.00056883 0.00073035 0.00073047 0.00073051 0.00091551 0.00073048 0.00047021 0.00047022 0.00046930 0.00047020 0.00047022
0.00027480 0.00027480 0.00027479 0.00027478 0.00027479 0.00056880 0.00056882 0.00056883 0.00056883 0.00056883 0.00073039 0.00073038 0.00073039 0.00073048 0.00090819 0.00047021 0.00047019 0.00047019 0.00047020 0.00047020
0.00014907 0.00014907 0.00014907 0.00014906 0.00014906 0.00027479 0.00027479 0.00027480 0.00027480 0.00027480 0.00047022 0.00047022 0.00047023 0.00047021 0.00047021 0.00078682 0.00059307 0.00059304 0.00059296 0.00059296
0.00014907 0.00014907 0.00014907 0.00014907 0.00014906 0.00027479 0.00027478 0.00027480 0.00027480 0.00027407 0.00047022 0.00047022 0.00047023 0.00047022 0.00047020 0.00059307 0.00078155 0.00059300 0.00059305 0.00059306
0.00014907 0.00014907 0.00014906 0.00014907 0.00014907 0.00027479 0.00027480 0.00027479 0.00027480 0.00027479 0.00047020 0.00047023 0.00047020 0.00046930 0.00047019 0.00059304 0.00059300 0.00077633 0.00059317 0.00059316
0.00014907 0.00014907 0.00014907 0.00014907 0.00014907 0.00027480 0.00027481 0.00027480 0.00027481 0.00027480 0.00047021 0.00047021 0.00047021 0.00047020 0.00047020 0.00059296 0.00059305 0.00059317 0.00077117 0.00059330
0.00014907 0.00014907 0.00014907 0.00014907 0.00014908 0.00027480 0.00027480 0.00027481 0.00027480 0.00027481 0.00047022 0.00047022 0.00047022 0.00047022 0.00047020 0.00059296 0.00059306 0.00059316 0.00059330 0.00076606];
Ck=[2.5440e-12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 2.5591e-12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 2.6064e-12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 2.6538e-12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 2.7013e-12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1.6227e-12 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1.9718e-12 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 2.5104e-12 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 2.5104e-12 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 2.5104e-12 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 2.5104e-12 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 2.5104e-12 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 2.5104e-12 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1.9718e-12 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.6227e-12 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.7013e-12 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.6538e-12 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.6064e-12 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.5591e-12 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.5440e-12];
Pij=[1e+12/3.5412+1e+12/2.5440 -1e+12/3.5412 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
-1e+12/3.5412 1e+12/3.5412+1e+12/4.21175+1e+12/2.5591 -1e+12/4.21175 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 -1e+12/4.21175 1e+12/4.21175+1e+12/5.22285+1e+12/2.6064 -1e+12/5.222850 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 -1e+12/5.22285 1e+12/5.22285+1e+12/6.93125+1e+12/2.6538 -1e+12/6.93125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 -1e+12/6.93125 1e+12/6.93125+1e+12/8.0238+1e+12/2.7013 -1e+12/8.0238 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 -1e+12/8.0238 1e+12/8.0238+1e+12/6.93125+1e+12/1.6227-1e+12/6.93125 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 -1e+12/6.93125 1e+12/6.93125+1e+12/5.22285+1e+12/1.9718-1e+12/5.22285 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 -1e+12/5.22285 1e+12/5.22285+1e+12/4.21175+1e+12/2.5104-1e+12/4.21175 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 -1e+12/4.21175 1e+12/4.21175+1e+12/3.5412+1e+12/2.5104-1e+12/3.5412 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 -1e+12/3.5412 1e+12/3.5412+1e+12/3.2659+1e+12/2.5104-1e+12/3.2659 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 -1e+12/3.2659 1e+12/3.2659+1e+12/3.5412+1e+12/2.5104-1e+12/3.5412 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 -1e+12/3.5412 1e+12/3.5412+1e+12/4.21175+1e+12/2.5104 -1e+12/4.21175 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 -1e+12/4.21175 1e+12/4.21175+1e+12/5.22285+1e+12/2.5104 -1e+12/5.22285 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 -1e+12/5.22285 1e+12/5.22285+1e+12/6.93125+1e+12/1.9718-1e+12/6.93125 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 -1e+12/6.93125 1e+12/6.93125+1e+12/8.0238+1e+12/1.6227 -1e+12/8.0238 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1e+12/8.0238 1e+12/8.0238+1e+12/6.93125+1e+12/2.7013 -1e+12/6.93125 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1e+12/6.93125 1e+12/6.93125+1e+12/5.22285+1e+12/2.6538 -1e+12/5.22285 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1e+12/5.22285 1e+12/5.22285+1e+12/4.21175+1e+12/2.6064 -1e+12/4.21175 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1e+12/4.21175 1e+12/4.21175+1e+12/3.5412+1e+12/2.5591 -1e+12/3.5412
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1e+12/3.5412 1e+12/3.5412+1e+12/1.63295+1e+12/2.5440 ];
Qi=
Qj=
Qi-Qj=
A=
V(t)=1.03725*exp(-0.014659*t)-1.03725*exp(-2.4689*t)
我自己把方程改写如下:
Qj’= B
B’ = -Fij*Qj+Gj* V ’’(t)+Wj*V(t)
编程如下:
function demoSSS(Fij,Gj,Wj,k1,k2)
syms t k1 k2;
options=odeset;options.RelTol=1e-30;%u=1;
t_final=0.5;y0=;
Fij=[7.3776e+014 -5.3238e+014 -1.5787e+014 -4.0056e+013 -1.1058e+014 1.037e+014 -1.7922e+012 1.9869e+012 1.4065e+011 -4.4552e+013 4.2947e+013 1.0149e+012 -5.8687e+011 1.6692e+010 7.1652e+012 -6.8828e+012 -6.4938e+008 1.1129e+011 -1.2371e+010 -9.7159e+012
-4.983e+014 1.0005e+015 -3.8027e+014 -9.8258e+013 -1.2163e+014 9.9149e+013 -1.6854e+012 1.3244e+012 7.1987e+010 -4.4408e+013 4.3066e+013 6.9462e+011 -4.6295e+011 -4.7252e+010 6.9631e+012 -6.652e+012 -2.529e+010 1.2026e+011 -1.867e+010 -9.4965e+012
-1.6152e+014 -3.4127e+014 9.2357e+014 -3.3226e+014 -1.7084e+014 8.6124e+013 -1.5869e+012 -1.124e+012 -1.9494e+011 -4.5839e+013 4.5184e+013 -1.6957e+010 -4.1817e+011 -4.0861e+010 6.4858e+012 -6.1878e+012 -5.5184e+010 1.6234e+011 -4.5177e+010 -9.0381e+012
-5.1081e+013 -9.5027e+013 -3.0209e+014 8.0127e+014 -3.7922e+014 4.8361e+013 -1.9054e+013 -1.4162e+012 -3.7578e+011 -5.3066e+013 5.4588e+013 -2.6769e+012 -4.3646e+011 7.326e+010 5.2373e+012 -5.0113e+012 -4.0873e+010 9.0299e+010 -1.5049e+010 -7.9804e+012
-1.667e+013 -2.0617e+013 -6.9702e+013 -2.5695e+014 6.0132e+014 -1.3304e+014 -8.7669e+013 -1.1116e+013 -2.2272e+012 -7.9305e+013 7.6143e+013 -9.4973e+010 -1.1992e+011 2.4144e+010 1.0404e+012 -1.0015e+012 2.8455e+010 -7.7816e+009 -7.0719e+009 -2.8316e+012
-3.1224e+012 -2.6759e+012 -1.0261e+013 -3.711e+013 -3.249e+014 8.8734e+014 -4.2311e+014 -6.1401e+013 -1.168e+013 -2.2645e+014 2.1301e+014 -2.7019e+011 1.4939e+012 -1.2589e+011 -2.0062e+013 1.9189e+013 1.0322e+011 -2.6918e+011 1.4034e+009 2.1293e+013
-1.3369e+012 -3.4468e+012 4.1373e+012 -9.3902e+012 2.4027e+013 -4.2346e+014 9.5448e+014 -4.2544e+014 -7.4545e+013 -2.5738e+014 2.1548e+014 -2.8802e+012 9.3938e+011 -2.1449e+011 -2.2802e+013 2.1709e+013 8.1825e+010 -3.8489e+011 1.4834e+011 2.3327e+013
-9.3164e+011 -8.7205e+009 -9.2727e+010 -1.7675e+012 7.8785e+013 -1.8271e+014 -2.8326e+014 8.8183e+014 -3.2299e+014 -3.2684e+014 1.7508e+014 -1.2864e+013 -1.9692e+012 -9.9553e+011 -2.4658e+013 2.3288e+013 7.6703e+010 -3.6681e+011 1.306e+011 2.1626e+013
-7.8835e+011 8.5221e+011 -1.3403e+012 3.2593e+011 8.9372e+013 -1.2226e+014 -8.1767e+013 -3.5204e+014 1.0081e+015 -5.4305e+014 6.1607e+013 -4.2971e+013 -1.0638e+013 -3.1566e+012 -3.0721e+013 2.8389e+013 1.6575e+011 -4.8364e+011 1.2925e+011 1.6892e+013
-5.8434e+011 8.4136e+011 -1.6645e+012 1.2889e+012 8.0626e+013 -9.3818e+013 -2.6642e+013 -1.077e+014 -3.7826e+014 9.7259e+014 -2.673e+014 -1.2943e+014 -3.5626e+013 -9.1685e+012 -4.7314e+013 4.2237e+013 2.2961e+011 -6.9063e+011 3.7773e+011 1.8421e+012
-1.9617e+010 3.645e+011 -2.1483e+012 2.8842e+012 4.0978e+013 -4.7199e+013 -9.1888e+012 -3.5661e+013 -1.2956e+014 -2.6665e+014 9.7189e+014 -3.7836e+014 -1.0741e+014 -2.6584e+013 -9.3776e+013 8.0904e+013 4.8287e+011 -1.2134e+012 8.3624e+011 -4.233e+013
2.4773e+011 1.3191e+011 -5.0068e+011 2.3997e+011 2.8364e+013 -3.0754e+013 -3.1429e+012 -1.0652e+013 -4.3094e+013 6.1989e+013 -5.434e+014 1.0082e+015 -3.5202e+014 -8.1762e+013 -1.2226e+014 8.9442e+013 1.6193e+011 -1.2402e+012 8.443e+011 -5.7184e+013
2.7278e+011 1.1388e+011 7.8965e+010 -6.7431e+011 2.3661e+013 -2.4733e+013 -9.7605e+011 -1.9757e+012 -1.2902e+013 1.7473e+014 -3.2601e+014 -3.2334e+014 8.8175e+014 -2.8327e+014 -1.8277e+014 7.8817e+013 -1.7067e+012 -1.1344e+011 -8.9139e+009 -6.4095e+013
3.683e+011 2.0924e+010 1.931e+011 -8.8214e+011 2.2189e+013 -2.2856e+013 -2.1709e+011 9.3566e+011 -2.8894e+012 2.1494e+014 -2.5627e+014 -7.498e+013 -4.2555e+014 9.5446e+014 -4.2353e+014 2.4045e+013 -9.2419e+012 4.0809e+012 -3.4102e+012 -7.7552e+013
3.0014e+011 5.2668e+010 2.5025e+011 -9.1406e+011 1.9681e+013 -2.0096e+013 -1.3365e+011 1.4898e+012 -2.7033e+011 2.1311e+014 -2.2673e+014 -1.1375e+013 -6.1523e+013 -4.2313e+014 8.8728e+014 -3.2492e+014 -3.688e+013 -1.0288e+013 -2.414e+012 -1.3084e+014
-3.395e+010 1.1707e+010 1.4579e+011 -2.7626e+011 -8.3012e+011 1.0062e+012 2.0622e+010 -1.2527e+011 -7.5589e+010 7.6015e+013 -7.9255e+013 -2.1193e+012 -1.116e+013 -8.7669e+013 -1.3341e+014 6.0172e+014 -2.5681e+014 -6.9144e+013 -1.8724e+013 -5.096e+014
-1.0362e+011 -2.6682e+009 1.6986e+011 -2.038e+011 -4.8266e+012 5.1227e+012 7.0168e+010 -4.3678e+011 -2.6639e+012 5.3935e+013 -5.2455e+013 -3.0836e+011 -1.4673e+012 -1.903e+013 4.6771e+013 -3.775e+014 8.0184e+014 -2.9966e+014 -8.6877e+013 -6.0835e+014
-1.1303e+011 -3.4309e+010 2.2239e+011 -1.8795e+011 -5.7498e+012 6.0932e+012 -4.4191e+010 -3.9442e+011 -4.3751e+010 4.2849e+013 -4.3478e+013 -1.4408e+011 -1.2488e+012 -1.4929e+012 8.0494e+013 -1.6481e+014 -3.3013e+014 9.3216e+014 -3.1238e+014 -6.6629e+014
-1.0403e+011 -7.3362e+009 1.5576e+011 -1.3593e+011 -5.4047e+012 5.7176e+012 -5.2212e+010 -3.682e+011 5.4396e+011 3.5616e+013 -3.6734e+013 9.92e+010 9.6568e+011 -1.3774e+012 8.1165e+013 -1.0243e+014 -9.1351e+013 -3.5287e+014 1.0928e+015 -7.6227e+014
-6.2997e+010 -4.7378e+008 8.6364e+010 -6.5552e+010 -3.3166e+012 3.4839e+012 6.8974e+009 -2.8966e+011 5.0894e+011 2.0891e+013 -2.1704e+013 9.9358e+010 9.5821e+011 -8.7351e+011 5.0444e+013 -5.3782e+013 -1.9509e+013 -7.6789e+013 -2.5898e+014 1.2074e+015];
Gj=[1.7238e-012
5.8209e-013
1.8219e-013
5.1371e-014
1.1935e-014
1.7316e-015
3.1441e-016
7.9299e-017
2.2746e-017
7.2835e-018
2.4983e-018
8.338e-019
2.5301e-019
5.9172e-020
9.9313e-021
2.0367e-021
4.4291e-022
1.1365e-022
3.1797e-023
6.9721e-024];
Wj=[2848.3
271.76
-604.32
-848
-790.53
-206.41
-124
-103.02
-92.173
-68.548
1.4904
27.058
35.278
38.265
34.868
-4.3394
-12.528
-13.638
-12.524
-7.5788];
k1=1.03725*exp(-0.014659*t)-1.03725*exp(-2.4689*t);
k2=0.00022289*exp(-0.0147*t)-6.3225*exp(-2.4689*t);
=ode45('rhsSSS',,y0,options,Fij,Gj,Wj,k1,k2);
subplot(111)
plot(t,y(1,:));
M文件中的程序:
function dx=rhsSSS(t,y,flag,Fij,Gj,Wj,k1,k2)
dx=[y(2);
-Fij*y(1)+Gj*k2+Wj*k1];
但是在命令窗口键入demoSSS却出不来任何图形可能我在这方面比较菜鸟
还请大虾们帮助做一下 谢谢!! syms t k1 k2;这样定义的是符号变量,后面是数字计算,肯定不合理的
回复 沙发 无水1324 的帖子
谢谢那像k1 k2 还有矩阵应该怎样定义呢??
我在书上没找到定义矩阵和多项式的语句
页:
[1]