在一个变量中求解混合方程

时间:2014-02-26 11:11:04

标签: wolfram-mathematica matlab equation-solving

我有这个等式,想要为v解决它。我试过Mathematica,但它无法做到。有没有软件,能够解决它的语言?

公式:

Solve[1 + 0.0914642/v^5 - 1.87873/v^4 + 96.1878/v^2 - (
17.3914 E^(-(0.0296/v^2)) (1.398 + 0.0296/v^2))/v^2 - 0.947895/v - 
1.37421 v == 0, v]

文本文件/ m文件为here

3 个答案:

答案 0 :(得分:2)

使用 Mathematica 9 : -

Clear[v]

expr = 1 + 0.0914642/v^5 - 1.87873/v^4 + 96.1878/v^2 - (
     17.3914 E^(-(0.0296/v^2)) (1.398 + 0.0296/v^2))/v^2 - 0.947895/v -
   1.37421 v;

sol = Solve[expr == 0, v, Reals]
  

{{v - > -0.172455},{v - > 0.0594091},{v - > 0.105179},{v - > 3.93132}}

检查解决方案: -

roots = v /. sol;
(v = #; expr) & /@ roots
  

{2.27374 * 10 ^ -13,2.32703 * 10 ^ -12,-9.66338 * 10 ^ -13,-1.77636 * 10 ^ -15}

(v = #; Chop[expr]) & /@ roots
  

{0,0,0,0}

答案 1 :(得分:1)

在Matlab中试试这个。您需要安装Symbolic Math Toolbox

>> syms v %// declare symbolic variable, used in defining y
>> y = 1 + 0.0914642/v^5 - 1.87873/v^4 + 96.1878/v^2 - (17.3914*exp(-(0.0296/v^2)) * (1.398 + 0.0296/v^2))/v^2 - 0.947895/v - 1.37421*v;
>> solve(y,v) %// seeks zeros of y as a function of v
ans =
3.931322452560060553464772086259
>> subs(y,3.931322452560060553464772086259) %// check
ans =
 -4.4409e-016 %// almost 0 (precision of floating point numbers): it is correct

答案 2 :(得分:0)

如果没有符号数学工具箱,您仍然可以使用fzero以数字方式执行此操作:

a1 = 8.99288497*10^(-2);
a2 = -4.94783127*10^(-1);
a3 = 4.77922245*10^(-2);
a4 = 1.03808883*10^(-2);
a5 = -2.82516861*10^(-2);
a6 = 9.49887563*10^(-2);
a7 = 5.20600880*10^(-4);
a8 = -2.93540971*10^(-4);
a9 = -1.77265112*10^(-3);
a10 = -2.51101973*10^(-5);
a11 = 8.93353441*10^(-5);
a12 = 7.88998563*10^(-5);
a13 = -1.66727022*10^(-2);
a14 = 1.39800000 * exp(0);
a15 = 2.96000000*10^(-2);
t = 30;
p = 10;

tr = t/(273.15 + 31.1);
pr = p/(73.8);

s1 = @(v) (a1 + (a2/tr^2) + (a3/tr^3))./v;
s2 = @(v) (a4 + (a5/tr^2) + (a6/tr^3))./v.^2;
s3 = @(v) (a7 + (a8/tr^2) + (a9/tr^3))./v.^4;
s4 = @(v) (a10 + (a11/tr^2) + (a12/tr^3))./v.^5;
s5 = @(v) (a13./(tr^3.*v.^2)).*(a14 + (a15./v.^2)).*exp(-a15./v.^2);
y = @(v) -(pr*v./tr) + 1 + s1(v) + s2(v) + s3(v) + s4(v) + s5(v);

root = fzero(y, [1 5]);
% Visualization
fplot(y, [1 5]); hold all; refline(0,0); line([root,root], [-10,30])