I have a nonlinear equation ,, which i didn't know how to put it in matlab

조회 수: 2 (최근 30일)
beso ss
beso ss 2018년 3월 1일
댓글: khouloud abiedh 2018년 7월 7일
the equation
x exp x = [(segma / KB * T ) ^ 2 - x ]* (tr/ttr) * exp(E0 - Ea)/KB * T
while :
segma = 13 , KB =8.617*10^-5 , tr= 250 , ttr= 0.027 , E0=1.185 , Ea=E0+0.073
T=0:300
and the other one is
E(T)= E0 -(0.00000048 * T^2) /(270 + T) - x * KB *T
while
E0=1.185 , KB =8.617*10^-5 and also T =0:300
can any one help me with it please
  댓글 수: 2
John D'Errico
John D'Errico 2018년 3월 1일
First, you need to explain what you need out of it.
beso ss
beso ss 2018년 3월 1일
i need to give a result for each x ,, that is means for every T there is an x for it ,,, if i but the other elemnts to the equation it will be
x exp x = [ ( 13 / 8.617*10^-5 * T )^2 - x ] * ( 250/0.027 ) * exp[ ( 0.073 ) / 8.617*10^-5 * T ]
there is still x and T but T change from 0 to 300
is it clear now href = ""</a>>>/?????

댓글을 달려면 로그인하십시오.

답변 (6개)

John D'Errico
John D'Errico 2018년 3월 2일
편집: John D'Errico 2018년 3월 2일
You responded to my question without explaining what E(T) has to do with anything.
So is it clear? Not fully. It seems you have written TWO equations, one for E(T) which seems to be used for nothing.
The first equation can be solved (IF a solution exists) using fzero. Thus, for EACH value of T, you will solve the problem independently. A loop would suffice, and there is no real reason to do anything more sophisticated than a loop.
T = 0:300;
X = zeros(size(T));
syms x
for n = 1:numel(T)
Eqn1 = x*exp(x) == [(segma / KB * T(n) ) ^ 2 - x ]* (tr/ttr) * exp(E0 - Ea)/KB * T(n);
X(n) = double(vpasolve(Eqn1,x));
end
The above solution could also have been trivially written to use fzero.
  댓글 수: 14
beso ss
beso ss 2018년 3월 4일
편집: beso ss 2018년 3월 4일
yes i know that the value of E1 it will be so tiny ,, but not equal to 1.185 it will be smaller than it ,,, it will be around 1 and 1.185 , and also ,,E1 and E2 don't have to be the same result
John D'Errico
John D'Errico 2018년 3월 4일
편집: John D'Errico 2018년 3월 4일
They Are NOT the same result!!!!!!!
format long g
E1 = 1.185-(0.00000048*T.^2)./(270+T);
E1(1:5)
ans =
1.185 1.18499999822878 1.18499999294118 1.18499998417582 1.1849999719708
E2(1:5)
ans =
1.185 1.18499999822878 1.18499999294117 1.18499998417581 1.18499997197075
Are they the same? No. Are they close as hell to each other? Of course. Because those other terms are SO small.
Consider E1.
It was computed from
E1 = 1.185-(0.00000048*T.^2)./(270+T);
So plot that second term in E1.
plot(T,(0.00000048*T.^2)./(270+T))
Look carefully at the y axis. Do you see on top the 10^-5 there?
That means all the elements in that plot are on the order of 8*10^-5, or SMALLER. So if we add 1.185 to a number that is SMALLER than 0.00001, and usually MUCH smaller than that, what do you expect to see?
How about E2? E2 is the same as E1. Except is has that term with X in it.
E2 = 1.185 - (0.00000048 * T.^2) ./ (270 + T) - 8.617e-5*X.*T;
Plot that last term now. Remember to look carefully at the y axis. Remember to look at the exponent attached to that axis. Do you see the 10^-7 there? That means that every number in that plot was smaller than 8e-7, but that the elements on the far left are FAR smaller than that.
plot(T,8.617e-5*X.*T)
Here are the first 5 elements of that term.
8.617e-5*X(1:5).*T(1:5)
ans =
0 2.24110912198165e-16 3.54526286107169e-15 1.77473849967693e-14 5.5470798356365e-14
Now, when you subtract a number of that size from 1.185, what do you expect to see?
Think abut what you are doing. Look carefully at the numbers involved.

댓글을 달려면 로그인하십시오.


beso ss
beso ss 2018년 3월 4일
can anyone answer me please
  댓글 수: 2
John D'Errico
John D'Errico 2018년 3월 4일
I did answer you. Did you think about what I said?
beso ss
beso ss 2018년 3월 4일
im sorry :( ,,,, thank you sooooo much ,,, some times i am so rush and i didn't git the hall answer in the same time ,, it comes separate ,,,
thank you all again very much

댓글을 달려면 로그인하십시오.


beso ss
beso ss 2018년 3월 17일
편집: Walter Roberson 2018년 3월 17일
Hi , it is me again
can i use another way to have numerically solve for the equation
syms x
X = zeros(size(T));
for n = 1:numel(T)
Eqn1 = x*exp(x) ==(( 13 / 8.617*10^-5 * T(n) )^2 - x ) * ( 250/0.027 ) * exp ( 0.073 ) / 8.617*10^-5 * T(n) ;
X(n) = double(vpasolve(Eqn1,x));
end
becouse in the plot there is a mistake i dont know way
the original equation is
x*exp(x) = (((sigma/(KB*T(i)))^2-x)*(tautr/taur)*exp(deltaE/(KB*T(i)))
where
sigma = 13*10^-3; %eV
deltaE = -0.073; %eV
E0 = 1.185; %eV
tautr = 0.027;
taur =250;
KB= 8.617*10^-5; %eV/K
T= 0:300
  댓글 수: 54

댓글을 달려면 로그인하십시오.


beso ss
beso ss 2018년 3월 21일

Yi-Lin Tsai
Yi-Lin Tsai 2018년 5월 4일
I have a nonlinear equation I see some references but i don't know to get each value about sigma tautr taur please help me
  댓글 수: 2
Walter Roberson
Walter Roberson 2018년 5월 4일
You should start a new Question on that topic. Be sure to include a copy of the equations.
beso ss
beso ss 2018년 5월 4일
편집: beso ss 2018년 5월 4일
ok i will ,i am going to write a new question.
thanks

댓글을 달려면 로그인하십시오.


khouloud abiedh
khouloud abiedh 2018년 7월 3일
편집: Walter Roberson 2018년 7월 4일
hello ,i m debutant in matlab and i need to do a fit of my experimental data by LSE model in matlab iwrite the last comment i write the same code of the energetic position of a gaussian but i find a problem to do an exact fit of the data by matlab ,also i need to do a fit of the LMH of the gaussian by this model in matlab .when i read the article i understand that it must resolve another equation numerically to find the LMH described in the LSE model.i use the same code but i change the equation but it display an error.i need our help please help me and thank you in advance.
%%trouver x et tracer la position energetique
sigma = 13*10^-3;%eV
deltaE = -73e-3;%eV
E0 = 1.185;%eV
Ea = E0+75e-3;
tautr=0.027 ;
taur=250;
Kb = 8.617*10^-5;%eV/K
theta = 270; %K
alfa = 0.48e-3;%eV/K
T= 0:10:300;
X = zeros(size(T));
E2 = zeros(size(T));
E1= zeros(size(T));
a = zeros(size(T));
syms x
for i=1:numel(T)
E1(i) = E0 -( alfa*T(i)^2)/(theta+T(i));
X(i) = vpasolve(((sigma/(Kb*T(i)))^2 - x)*(taur/tautr)*exp(deltaE/(Kb*T(i)))-x*exp(x)==0,x);
E2(i) = E0 -(alfa*T(i)^2)/(theta + T(i))-X(i)*Kb*T(i);
a(i) = X(i)*Kb*T(i);
end
figure(1);plot(T,E1,'r.');
figure(2);plot(T,E2,'g')
hold on ;plot(T,E1,'r')
figure(3);plot(T,X,'k.','Markersize',5)
figure(4);plot(T,a,'k');
%%to find LMH i must resolve n(E0-X(T)*Kb*T,T)/2=n(E,T)
trouver n(E0-X(T)*Kb*T,T)/2
n(E,T)= exp(-(E(i)-E0)^2/(2*sigma^2)/(exp((E(i)-Ea)/(Kb*T(i)))+(tautr/taur)))
E = zeros(size(T));
n = zeros(size(T));
n1=zeros(size(T));
for i=1:numel(T)
E(i)= E0-a(i);
n(i)=exp(-(E(i)-E0).^2/(2*sigma^2))/(exp((E(i)-Ea)/(Kb*T(i)))+(tautr/taur));
n1(i)=n(i)/2;
end
figure (5)
plot(E1,n1)
X1=zeros(size(T));
syms x1
for i=1:numel(T)
X1(i) = vpasolve(exp(-(E(i)-E0)^2/(2*sigma^2))/(exp((E(i)-Ea)/(Kb*T(i)))+(tautr/taur))-n1(i)==0,x1);
end
figure(6);plot(T,X1,'r.')
  댓글 수: 3
khouloud abiedh
khouloud abiedh 2018년 7월 7일
hello dear Walter Roberson i start a new question in this topic i tag you but i don't know if i do a fault and i tag another person.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Nonlinear Analysis에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by