Thread Closed

simulation of rate equation

 
Share Thread Thread Tools
Jul17-10, 10:07 PM   #1
 

simulation of rate equation


i have try this rate equation code in MATLAB. but its not working. can anyone help me please!!!!!
mm=0;

for I = 0.1e-3:0.1e-3:4.5e-3;
m=mm+1;
q=1.6e-19;
alpha=2;
Tn=3e-9;
Tp=1e-12;
G0=0.6;
N0 = 1e24;

Gamma=.2;
epsilon=1e1;
Va=3.7e-14;
tini=0;
tfin=4e-9;
dt=1e-12;
N(1)=0;
S(1)=0;
p=G0*N(m)*S(m);
l=1+epsilon*S(m);
y=q*Va;
for t=tini:dt:tfin
delN=(I/y)-(N(m)/Tn)-(p/l);



end

end

tt=t;
tt=tt*1e9;
figure(1);
plot(tt,N);
 
PhysOrg.com
PhysOrg
engineering news on PhysOrg.com

>> Company pioneering new types of material for 3-D printer 'ink'
>> Student-built innovations to help improve and save lives
>> Researchers use light projector and single-pixel detectors to create 3-D images
Jul18-10, 07:06 AM   #2
 
I'm not sure whether Matlab requires that you define your variables before attempting to execute them, but I see that line 4, for example, (I0 = N0*q*Va/Tn;) contains several variables you do not define until later in your routine.
 
Jul19-10, 11:55 AM   #3
 
Mentor
Quote by almesba View Post
i have try this rate equation code in MATLAB. but its not working. can anyone help me please!!!!!
mm=0;

for I = 0.1e-3:0.1e-3:4.5e-3;
m=mm+1;
q=1.6e-19;
alpha=2;
Tn=3e-9;
Tp=1e-12;
G0=0.6;
N0 = 1e24;

Gamma=.2;
epsilon=1e1;
Va=3.7e-14;
tini=0;
tfin=4e-9;
dt=1e-12;
N(1)=0;
S(1)=0;
p=G0*N(m)*S(m);
l=1+epsilon*S(m);
y=q*Va;
for t=tini:dt:tfin
delN=(I/y)-(N(m)/Tn)-(p/l);



end

end

tt=t;
tt=tt*1e9;
figure(1);
plot(tt,N);
Welcome to the PF. What do you mean by "not working"? Does MATLAB throw an error somewhere, or does the program run and not give a reasonable answer?
 
Jul19-10, 01:30 PM   #4
 

simulation of rate equation


Quote by berkeman View Post
Welcome to the PF. What do you mean by "not working"? Does MATLAB throw an error somewhere, or does the program run and not give a reasonable answer?
MATLAB isnt throwing any error. NOT WORKING means i am getting a white or blank graph. i have tried with different axis values but still no result.
 
Jul19-10, 02:30 PM   #5
 
Recognitions:
Science Advisor Science Advisor
Code:
p=G0*N(m)*S(m);
l=1+epsilon*S(m)
Both those lines are bound to throw an error on the second iteration because neither N() or S() are defined past an index of 1.
 
Thread Closed
Thread Tools


Similar Threads for: simulation of rate equation
Thread Forum Replies
Equation used in simulation software Electrical Engineering 2
Laser rate equation(ODE) simulation problem Differential Equations 21
rate of reaction, rate constants, and Arrhenius' Equation Introductory Physics Homework 0
Finding the rate equation and rate constant Biology, Chemistry & Other Homework 0
problem in simulation of optically pumped VCSEL rate equation... Differential Equations 0