I WANT TO SOLVE THE EQUATION for x: x*exp(x)=(a1-x)*a2*a3 . Here a1 and a3 are matrices and a2 is a constant. I cant solve the equation using solve

1 次查看(过去 30 天)
sigma=25;
k=8.61*10^(-5);
T=linspace(100,500);
E0=1.025;
Ea=E0+0.044;
t1=1;
t2=40;
a1=(sigma./(k.*T)).^2;
a2=(t1/t2);
a3=exp((Ea-E0)./(k.*T));
This is the code for the problem

采纳的回答

Ahmed A. Selman
Ahmed A. Selman 2013-4-12
True, indeed.
Not only for (A,B) = (11,13) and (3,-6), but for a wide range of other set, including the given coefficients.. I got confused, and enthusiastic, with the closed-form solution.
Thanks Walter, I'm appreciated :)
@Dip Samajdar,
then, as a complement, please check the code below for your problem:
clc
clear
sigma=25;
k=8.61*10^(-5);
T=linspace(100,500);
E0=1.025;
Ea=E0+0.044;
t1=1;
t2=40;
a1=(sigma./(k.*T)).^2;
a2=(t1/t2);
a3=exp((Ea-E0)./(k.*T));
syms x
A=a1.*a2.*a3;
B=a2*a3;
for i=1:numel(A)
i
y=x*exp(x) - A(i) + B(i)*x;
OutPut1(i)=solve(y);
end
clc
disp('The solution is, in a matrix form, ');
OutPut=double(OutPut1)
This I've checked and it works alright, but it might take a minute or two to finish. Regards.

更多回答(1 个)

Ahmed A. Selman
Ahmed A. Selman 2013-4-12
The equation you wrote is
x*exp(x)=(a1-x)*a2*a3
y= x*exp(x)-(a1-x)*a2*a3
y= x*exp(x)-a1*a2*a3 +x*a2*a3
Let:
a1*a2*a3 = A
a2*a3 = B
then:
y= x*exp(x)-A + B*x
if the solution means finding the roots of (x) at which (y=0), then your equation has no mathematical solution, regardless the sizes of A and B.
There are two solutions, however,
1) when you put:
A = 0
y= x*exp(x) + B*x
with one certain solution at x = 0. The condition (A = 0), according to your input, implies that (a1=0), meaning (segma = 0).
2) when you put
B = 0
y= x*exp(x) + A
reducing directly to Lambert formula.
  1 个评论
Walter Roberson
Walter Roberson 2013-4-12
Let A=11, B=13, then x*exp(x) - A + B*x has a solution at approximately 0.7297101197 . There is no analytic solution, but that is not the same as saying there is no mathematical solution.
For A=3 and B about -6, there are two roots, one positive and one negative.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by