Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
how resolve numerically non linear equation
조회 수: 1 (최근 30일)
이전 댓글 표시
hello , i'm debutant in matlab and i need to do a fit of my experimental data by LSE model in matlab i write 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.');
댓글 수: 2
Walter Roberson
2018년 7월 7일
This appears to duplicate https://www.mathworks.com/matlabcentral/answers/408774-how-modelise-write-a-code-of-lse-model-by-matlab-and-how-to-do-a-fit-of-a-experimental-data-with
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!