I need to Compute the expression for two functions. q[t] and q1[t] over certain range of time. The code is given below.
Remove["Global`*"];
e = 1.6*10^-19;
h = 6.63*10^-34;
phi = 0.33*1.6*10^-19;
s = 66*10^-9;
m = 9.11*10^-31;
A = 10^-4;
pi = 3.14;
\[Epsilon]0 = 8.85*10^-12;
k1 = 7;
k2 = 7;
dt = 100*10^-9;
r = 1;
fre = 10000;
v0 = 8.7;
T = .5*(1/fre);
v[t] = (v0*Sin[2*\[Pi]*fre*t]);
ListPlot[Table[{t, %}, {t, 0, T, T/(1000 + 1)}]]
c0 = (A*\[Epsilon]0*k1)/dt;
cap = c0/(1 + (((s*q1[t])/(dt*q[t]))));
eQ = (q[t] + q1[t])/(2*A*\[Epsilon]0*k2);
vk = eQ*s;
ik1 = (e*A)/(2*\[Pi]*h*s^2) ((phi - (e*vk)/2)*E^((-((4*\[Pi]*(Sqrt[2*m])*s)/h))*(Sqrt[phi - (e*vk)/2])) - (phi + (e*vk)/2)*E^((-((4*\[Pi]*(Sqrt[2*m])*s)/h))*(Sqrt[phi + (e*vk)/2]))); (* for evk<phi*)
ik2 = (e^3*A*vk^2)/(4*\[Pi]*h*s^2) (E^(-((4*\[Pi]*(Sqrt[m])*s*phi^1.5)/(h*e*vk))) - (1 + (2*e*vk)/phi)*E^((-((4*\[Pi]*(Sqrt[m])*s*phi^1.5)/(h*e*vk)))*Sqrt[(1 + (2*e*vk)/phi)])); (* for evk>phi*)
(* Below two lines are kind of Pseudocode lines to define "ik" in the dsolve expression . I am so sorry I don't know how to define this kind of if condition in mathematica and hen using in dsolve *)
ik = If[evk < phi, ik1, ik2];
qq = First@NDSolve[{q'[t] == v[t]/r - q[t]/r*(1/cap), q1'[t] == ik, q[0] == 10^-6, q1[0] == 10^-6}, {q, q1}, t];
Rationalize@ComplexExpand[q[t] /. qq];
Plot[%, {t, 0, T}]
Rationalize@ComplexExpand[q1[t] /. qq];
Plot[%, {t, 0, T}]
I want to calculate the expression for q[t] and q1[t]. The initial conditions can be changed to any value within the range of 10^-12 to 0.
Edit : The Dsolve is not essential, I NDsolve can also be used.
The time range over which NDSolve is DSOLVE is computed can also be change to any range of time.