Re: quantum equation in matlab




"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&#8706;/&#8706;v&#8747;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


.



Relevant Pages

  • Re: Wolfram Research QA process defect: Bug in Mathematica 6 - Integrate - 68 (Sqrt, invalid
    ... I do not knowck the capabilities of Matlab. ... definite integration doesn't work in general, ... and auto-code capabilities, ... similar may be handled by radically different code inside the CAS, e.g., ...
    (sci.math.symbolic)
  • Re: Problem with quad/quadl in matlab
    ... MATLAB is employing for various numerical operations. ... The user goes back and uses quad, ... might be as simple as Simpson's rule for integration. ... Do not use this device on someone elses fingers ...
    (comp.soft-sys.matlab)
  • Re: ode45 output
    ... the integration. ... I followed the steps (i.e. persistent variables, ... > Do you want your ODE function to accept additional input arguments ... > If you're using a version of MATLAB prior to 7.0, ...
    (comp.soft-sys.matlab)
  • Re: Matlab freezes when I try to integrate a function with symbolic variables
    ... then specific technical code question. ... Is this a processing problem with my CPU or is there ... anything I can do with MATLAB. ... complete the integration. ...
    (comp.soft-sys.matlab)
  • Re: Problem with quad/quadl in matlab
    ... I try to do this integration using matlab: ... When I do integration, quad/quadl can not ... The best material model of a cat is another, or preferably the same, cat. ...
    (comp.soft-sys.matlab)

Loading