MATLAB: 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

solution of nonlinear equation

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

Best Answer

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.