Re: quantum equation in matlab
- From: "Steven Lord" <slord@xxxxxxxxxxxxx>
- Date: Thu, 26 Feb 2009 09:33:20 -0500
"Theo Kalfas" <k_thodoros@xxxxxxxx> wrote in message
news:go5lba$rft$1@xxxxxxxxxxxxxxxxxxxxx
Hi everyone,
i have a difficult exercise in matlab and i need your help if anyone
knows.
This is a topic which i posted again and again(now i have more
information) and i dont't know if the code which i wrote is correct.
The idea of this exercise is to insert a theoretical equation Cdot in
Matlab.With the results which it'll give me,i want to create a theoretical
graph with axis x(v) and y(Cdot).Finally this graph i want to compare it
with one experimental graph which i have.Summary,my goal is to find the
best combination of ndot,M,edot in which the theoretical graph to be quite
similar to experimental graph(sorry for my bad English).
The equation which i have is:
a=1/(1+exp((E - Vdot)/(k*T)))
b=(G*Ndot)/sqrt((pi*M)/2)
c=exp(-2((E + Edot + Vdot)/M)^2)
Cdot=q*A*L∂/∂v∫a*b*c dE
where Vdot=v/L and M=de(this name i gave it in my code).The integral i
want to be [0,+inf] with respect to E.
The total equation which i want to insert in matlab is
Total=Cdot1+Cdot2+C.
Cdot1,Cdot2 are 2 different distrubutions and
C=A*(sqrt((q*ep*e0*Nd)./(2*(Vbi-v-k*T))))
Now the code which i thought is:
Firstly,i make 2 m-files with names integral1,integral2 which has this
function(everything i do here is the same with m-file integral2):
[code]
function subtotal1=integral1(ndot1,de1,v1)
A=12.56e-4; %this value is static,not change
L=0.44; %this value is static,not change
G=2; %this value is static,not change
T=300.0; %this value is static,not change
q=1.6e-19; %this value is static,not change
k=8.62e-5; %this value is static,not change(Boltzman)
Edot1=-0.3; %between -0.6-0.6
syms E; %(define) E
a=1/(1+exp((E-(v/L))/(k*T)));
b=(G*ndot1)./(sqrt((pi*de1)/2));
ek8eths1=((E+Edot1+(v/L))/de1).^2;
c=exp(-2*ek8eths1);
final1=a.*c*b;
inline_final1 = vectorize (inline (char (final1)));
subtotal1 = quad (inline_final1,0,1e13);
If you're using this as an "approximation" of the integral from 0 to Inf,
don't. Read these two posts for a description as to why this may not return
what you expect.
http://www.mathworks.com/matlabcentral/newsreader/view_thread/122969#310160
http://www.mathworks.com/matlabcentral/newsreader/view_thread/151640
[/code]
My problem is the last 2 lines.I'm not sure if this is the best way to
find the integral.Also,if i try quad (inline_final1,0,inf) then all the
values are NaN.Why?
What happens when you try to break up an infinite region into pieces?
Use QUADGK instead of trying to "trick" QUAD into performing an integration
over an essentially infinite region, or tighten your limits of integration
so that there's not a lot of space where the integral is (essentially) zero
near the limits.
*snip*
--
Steve Lord
slord@xxxxxxxxxxxxx
.
- References:
- quantum equation in matlab
- From: Theo Kalfas
- quantum equation in matlab
- Prev by Date: Re: (Simple problem) Interpolation 2D
- Next by Date: Re: string inputs for anonymous function
- Previous by thread: Re: quantum equation in matlab
- Next by thread: circle intersection help
- Index(es):
Relevant Pages
|
Loading