i have a nonlinear equation 2
Afficher commentaires plus anciens
i have three equations which are nonlinear equations , i want to use only Biesction method to solve it in matlab ,,
E1= E0 – (alfa* T^2)/(theta+T)
E2= E0 – (alfa* T^2) / (theta+T) – x * KB * T
(x * e^x)= [(sigma /(KB * T))^2 – X ] * (τaur/τautr ) * e^(((E0 – Ea)) ⁄ KB * T)
where E1 and E2 are the energy , and they are related to each other the diffrent is in E2 we have the part of x incloud ,, and x change each time when T change , it is a small change but it apear in the figer
,,T is the temperature and it is change from 0 to 300 ,, x is the temperature-dependent coefficient and i have a condition on x which is : 0<X < (sigma/(KB.*T(i)))^2
that x is larger than zereo and less than (sigma/(KB*T(i)))^2
sigma = 33*10^-3; %eV
deltaE = -0.80; %eV , deltaE means E0 – Ea
E0 = 3.184; %eV
alfa=0.011; % ev/k
tautr/taur =0.08;
theta=630; %K
KB= 8.617*10^-5; %eV/K
T= 0:300;
......................
I write the equation for x in biesction method but i dont know how to write the condition on x inside it ,, also ,, the plot give me a result for x which are minuse and thats wrong
syms sigma deltaE E0 tautr taur KB E2 alfa theta
sigma = 33*10^-3; %eV
deltaE = -0.080; %eV
E0 = 3.184; %eV
tautr =0.08;
taur=1.0;
theta= 630;% K
alfa= 0.0011 ; % ev/k
KB= 8.617*10^-5; %eV/K
T=0:300;
X=zeros(1,numel(T));
E2 = zeros(size(T));
for i=1:numel(T)
syms x
min=0;
max=(sigma/(KB*T(i)))^2;
f=@(x) ((sigma/(KB*T(i)))^2-x)*(tautr/taur)*exp(deltaE/(KB*T(i)))-x*exp(x);
X(i)=bisection(f,f(max),f(min))
E2(i) = E0 -( alfa * T(i)^2 )/(theta + T(i)) - X(i) * KB * T(i);
clear x
end
plot(T,X)
plot(T,E2)
3 commentaires
beso ss
le 5 Mai 2018
Yi-Lin Tsai
le 14 Mai 2018
Modifié(e) : Walter Roberson
le 14 Mai 2018
Dear beso ss do you know how to get this value
sigma = 33*10^-3; %eV
deltaE = -0.080; %eV
E0 = 3.184; %eV
tautr =0.08;
taur=1.0;
theta= 630;% K
alfa= 0.0011 ; % ev/k
Réponses (1)
Walter Roberson
le 6 Mai 2018
0 votes
Because of the division by T, there is no solution for T = 0. As T approaches 0, it becomes difficult to track down what the solutions, x, are.
For example as T approaches 1/100, I am seeing some suggestion that there is a solution between 10^-40311.72 and 10^-40311.71 but it is tricky to nail down, as the values switch between roughly -2.4018*10^(-40314) and 2.0366*10^(-40314)
For T = 1, there is a solution, but it is too small to represent.
The solutions from T = 1 to 300 are approximately
[0.74397e-399, 0.73862e-198, 0.51985e-131, 0.11637e-97, 0.10762e-77, 0.20581e-64, 0.60189e-55, 0.73029e-48, 0.22970e-42, 0.56185e-38, 0.21492e-34, 0.20475e-31, 0.67035e-29, 0.94908e-27, 0.68765e-25, 0.28927e-23, 0.77801e-22, 0.14420e-20, 0.19542e-19, 0.20298e-18, 0.16791e-17, 0.11413e-16, 0.65405e-16, 0.32290e-15, 0.13983e-14, 0.53932e-14, 0.18768e-13, 0.59589e-13, 0.17428e-12, 0.47341e-12, 0.12031e-11, 0.28785e-11, 0.65202e-11, 0.14050e-10, 0.28929e-10, 0.57130e-10, 0.10858e-9, 0.19924e-9, 0.35389e-9, 0.61001e-9, 0.10227e-8, 0.16709e-8, 0.26655e-8, 0.41583e-8, 0.63537e-8, 0.95218e-8, 0.14013e-7, 0.20275e-7, 0.28873e-7, 0.40505e-7, 0.56031e-7, 0.76488e-7, 0.10312e-6, 0.13740e-6, 0.18105e-6, 0.23608e-6, 0.30480e-6, 0.38982e-6, 0.49413e-6, 0.62107e-6, 0.77436e-6, 0.95814e-6, 0.11770e-5, 0.14357e-5, 0.17399e-5, 0.20954e-5, 0.25083e-5, 0.29854e-5, 0.35339e-5, 0.41614e-5, 0.48758e-5, 0.56855e-5, 0.65993e-5, 0.76264e-5, 0.87762e-5, 0.10059e-4, 0.11484e-4, 0.13062e-4, 0.14804e-4, 0.16720e-4, 0.18822e-4, 0.21121e-4, 0.23628e-4, 0.26355e-4, 0.29312e-4, 0.32512e-4, 0.35966e-4, 0.39685e-4, 0.43681e-4, 0.47965e-4, 0.52548e-4, 0.57441e-4, 0.62654e-4, 0.68199e-4, 0.74086e-4, 0.80325e-4, 0.86925e-4, 0.93896e-4, 0.10125e-3, 0.10899e-3, 0.11713e-3, 0.12567e-3, 0.13463e-3, 0.14400e-3, 0.15381e-3, 0.16405e-3, 0.17472e-3, 0.18585e-3, 0.19742e-3, 0.20945e-3, 0.22194e-3, 0.23490e-3, 0.24832e-3, 0.26221e-3, 0.27657e-3, 0.29141e-3, 0.30673e-3, 0.32252e-3, 0.33879e-3, 0.35554e-3, 0.37277e-3, 0.39048e-3, 0.40867e-3, 0.42733e-3, 0.44647e-3, 0.46608e-3, 0.48616e-3, 0.50671e-3, 0.52772e-3, 0.54920e-3, 0.57114e-3, 0.59353e-3, 0.61637e-3, 0.63965e-3, 0.66338e-3, 0.68755e-3, 0.71214e-3, 0.73716e-3, 0.76260e-3, 0.78845e-3, 0.81472e-3, 0.84138e-3, 0.86844e-3, 0.89588e-3, 0.92371e-3, 0.95191e-3, 0.98048e-3, 0.10094e-2, 0.10387e-2, 0.10683e-2, 0.10983e-2, 0.11286e-2, 0.11592e-2, 0.11901e-2, 0.12214e-2, 0.12529e-2, 0.12847e-2, 0.13169e-2, 0.13492e-2, 0.13819e-2, 0.14148e-2, 0.14480e-2, 0.14814e-2, 0.15150e-2, 0.15489e-2, 0.15830e-2, 0.16173e-2, 0.16518e-2, 0.16864e-2, 0.17213e-2, 0.17564e-2, 0.17916e-2, 0.18270e-2, 0.18625e-2, 0.18982e-2, 0.19340e-2, 0.19700e-2, 0.20061e-2, 0.20423e-2, 0.20786e-2, 0.21150e-2, 0.21515e-2, 0.21881e-2, 0.22248e-2, 0.22615e-2, 0.22983e-2, 0.23352e-2, 0.23721e-2, 0.24091e-2, 0.24461e-2, 0.24832e-2, 0.25203e-2, 0.25574e-2, 0.25945e-2, 0.26316e-2, 0.26687e-2, 0.27058e-2, 0.27429e-2, 0.27800e-2, 0.28171e-2, 0.28541e-2, 0.28911e-2, 0.29281e-2, 0.29651e-2, 0.30019e-2, 0.30388e-2, 0.30756e-2, 0.31123e-2, 0.31489e-2, 0.31855e-2, 0.32220e-2, 0.32584e-2, 0.32948e-2, 0.33310e-2, 0.33672e-2, 0.34032e-2, 0.34392e-2, 0.34751e-2, 0.35108e-2, 0.35465e-2, 0.35820e-2, 0.36174e-2, 0.36527e-2, 0.36878e-2, 0.37228e-2, 0.37577e-2, 0.37925e-2, 0.38271e-2, 0.38616e-2, 0.38959e-2, 0.39301e-2, 0.39642e-2, 0.39981e-2, 0.40318e-2, 0.40654e-2, 0.40988e-2, 0.41321e-2, 0.41652e-2, 0.41981e-2, 0.42309e-2, 0.42635e-2, 0.42959e-2, 0.43282e-2, 0.43603e-2, 0.43922e-2, 0.44239e-2, 0.44554e-2, 0.44868e-2, 0.45180e-2, 0.45490e-2, 0.45798e-2, 0.46104e-2, 0.46409e-2, 0.46711e-2, 0.47012e-2, 0.47311e-2, 0.47608e-2, 0.47903e-2, 0.48195e-2, 0.48486e-2, 0.48776e-2, 0.49063e-2, 0.49348e-2, 0.49631e-2, 0.49912e-2, 0.50191e-2, 0.50468e-2, 0.50744e-2, 0.51017e-2, 0.51288e-2, 0.51557e-2, 0.51825e-2, 0.52090e-2, 0.52353e-2, 0.52614e-2, 0.52873e-2, 0.53130e-2, 0.53385e-2, 0.53638e-2, 0.53889e-2, 0.54139e-2, 0.54386e-2, 0.54631e-2, 0.54873e-2, 0.55114e-2, 0.55353e-2, 0.55590e-2, 0.55825e-2, 0.56058e-2, 0.56289e-2, 0.56518e-2, 0.56745e-2, 0.56970e-2, 0.57193e-2, 0.57413e-2, 0.57632e-2, 0.57849e-2, 0.58064e-2, 0.58277e-2, 0.58488e-2]
2 commentaires
beso ss
le 6 Mai 2018
Walter Roberson
le 6 Mai 2018
We do not know. You are using a routine, "bisection", that we do not have the source to. Perhaps the code for it is wrong. Perhaps you are calling it incorrectly. Currently you are calling
X(i)=bisection(f,f(max),f(min))
but it would seem more likely that you should be calling
X(i) = bisection(f, min, max)
I usually find it a waste of time to try to debug a program that uses "min" or "max" or "sum" as a variable name.
Catégories
En savoir plus sur Mathematics and Optimization dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
