hi everyone, I have been stuck alot of times on that so please help me , I need to solve coupled differential equation with constraint,
1 次查看(过去 30 天)
显示 更早的评论
d(c_g)/dt=(i(dc_g)/dt=(i/ℏ)*(E_g+A*cos(wt) )*c_g+B*cos(wt)*c_e
d(c_e)/dt=(i/ℏ)*(E_e+D*cos(wt) )*c_e+C*cos(wt)*c_g
With constrain
|c_e |^2+|c_g |^2=1
c_g (t=0)=1
c_e (t=0)=0
I tried the following code :
syms c_g(t) c_e(t)
ode1 = diff(c_g) == (-1i/hbar)*((E_g+A*perturb(t))*c_g+B*perturb(t)*c_e);
ode2 = diff(c_e) == (-1i/hbar)*((E_fex+D*perturb(t))*c_e+C*perturb(t)*c_g);
odes = [ode1; ode2];
cond1 = c_g(0) == 1;
cond2 = c_e(0) == 0;
conds = [cond1; cond2];
[c_g(t), c_e(t)] = dsolve(odes,conds);
fplot(abs(c_g).^2)
hold on
fplot(abs(c_e).^2)
grid on
legend('c_g^2','c_e^2','Location','best')
so how could I enter the constraint to matlab , c_e^2,c_g^2 are probabilities
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Equation Solving 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!