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 view (last 30 days)
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

Answers (0)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!