在Matlab中求解一个给出[空sym]误差的方程

时间:2015-04-08 16:58:57

标签: matlab equation numerical-methods

我需要在Matlab中解决一个等式(请参阅下面的代码),但它给了我[空sym]错误。我尝试了solve()和vpasolve()函数,但没有工作。我感谢任何线索或评论。

% HK1:
% Longitude:
% Linear model Poly8:
clc
clear all
syms x 
 f_1(x) = -484.3*x^8 + 3128*x^7 -8743*x^6 + 1.381e+04 *x^5 -1.347e+04   *x^4 + 8311*x^3  -3164*x^2 + 679.1*x -62.88;

% Latitude:
% Linear model Poly8:
 f_2(x) = -2283*x^8 + 1.537e+04 *x^7 -4.495e+04 *x^6 + 7.453e+04 *x^5 -7.663e+04 *x^4 + 5.003e+04 *x^3 -2.025e+04 *x^2 + 4647 *x  - 462.7;

% Depth:
% Linear model Poly8:
 f_3(x) = -5.301e+04 *x^8 + 3.605e+05 *x^7 -1.065e+06 *x^6 + 1.785e+06 *x^5 -1.856e+06 *x^4 + 1.226e+06 *x^3 -5.019e+05 *x^2 + 1.165e+05 *x   -1.172e+04;

% Time:
% Linear model Poly8:
 f_4(x) = -1988 *x^8 + 1.364e+04 *x^7 -4.06e+04 *x^6 + 6.846e+04 *x^5  -7.151e+04 *x^4 + 4.74e+04 *x^3  -1.947e+04 *x^2 + 4529 *x  - 457.2 ;

% Magnitude:
% Linear model Poly8:
 f_5(x) = -6.487e+05  *x^8 + 4.395e+06 *x^7  -1.292e+07 *x^6 + 2.154e+07 *x^5  -2.224e+07 *x^4 + 1.457e+07 *x^3  -5.914e+06 *x^2 + 1.359e+06 *x   -1.354e+05 ;

M(x) = f_1(x)* f_2(x) * f_3(x) * f_4(x) * f_5(x);
syms x t
L1 (t) = int(M(x),x, 0, t)

% IL:
% Longitude:
% Linear model Poly8:
 f_6(x) = -1036  *x^8 + 7327 *x^7  -2.259e+04 *x^6 + 3.962e+04  *x^5   -4.324e+04  *x^4 + 3.007e+04 *x^3  -1.3e+04 *x^2 + 3196 *x    -341.9 ;

% Latitude:
% Linear model Poly8:
 f_7(x) =  -778  *x^8 +  5256  *x^7  -1.549e+04 *x^6 + 2.604e+04  *x^5   -2.73e+04  *x^4 + 1.829e+04 *x^3   -7650 *x^2 + 1825 *x     -190.2  ;

% Depth:
% Linear model Poly8:
 f_8(x) = -5.47e+05  *x^8 + 3.832e+06 *x^7  -1.17e+07 *x^6 + 2.035e+07  *x^5   -2.203e+07  *x^4 + 1.521e+07 *x^3   -6.534e+06 *x^2 + 1.597e+06 *x  -1.701e+05 ;

% Time:
% Linear model Poly8:
 f_9(x) = -1.142e+04  *x^8 +  8.06e+04 *x^7  -2.473e+05 *x^6 + 4.31e+05  *x^5   -4.665e+05  *x^4 + 3.212e+05 *x^3  -1.374e+05 *x^2 + 3.337e+04 *x   -3525 ;

% Magnitude:
% Linear model Poly8:
 f_10(x) =  2.688e+06  *x^8  -1.86e+07 *x^7 + 5.595e+07  *x^6 -9.558e+07  *x^5  + 1.014e+08  *x^4 -6.848e+07 *x^3  +2.872e+07 *x^2 -6.846e+06 *x   +7.099e+05 ;

N(x) = f_6(x) * f_7(x) * f_8(x) * f_9(x) * f_10(x);
syms x t
L2 (t) = int(N(x),x ,0, t)

L (t) = L1 (t)+ L2 (t);

syms t
eqn = 1 - exp ( - L (t) ) * (1 + L (t) + (L (t) ^2) / 2 + ( L (t) ^3) / 6 + (L (t)^4) / 24) == 0.90;
S = vpasolve(eqn,t)

1 个答案:

答案 0 :(得分:0)

我可以通过提供初步猜测得到结果:

S = vpasolve(eqn,t, [-1, 1])

这导致:

S =

0.00000000000000000028900339161215350816654043972505

在此范围内绘制函数可视化解决方案:

ezplot(1 - exp ( - L (t) ) * (1 + L (t) + (L (t) ^2) / 2 + ( L (t) ^3) / 6 + (L (t)^4) / 24)-0.9,[0.00000000000000000025, 0.00000000000000000035])

ezplot of function