Error using ode arguments (line 90) SCHROE must return a column vector?
Afficher commentaires plus anciens
This is to simulate a nth Eigenstate of a initial hamiltonian being carried under the Schrodinger equation to the nth eigenstate of the final hamiltonian.
Script:
function [dy]= schroe(t, y);
global lambda Delta
H0 = [ lambda*t, Delta
Delta, -lambda*t];
dy=-1i*H0*y;
Command Window:
lambda=1;
Delta=1;
Hz=20;
tt = [0/lambda:Hz/lambda/200:Hz/lambda];
y0 = [.999688036058711-.024976600270607];
options = odeset('Reltol', 1e-6, 'AbsTol', 1e-6);
[ttotal, ytotal] = ode45(@schroe, tt, y0, options);
for ii= 1:201;
ti=tt(ii);
H0 = [ lambda*ti, Delta
Delta, -lambda*ti];
[vt, et] = eig(H0);
psit=transpose(ytotal(ii,:));
vg=vt(:,1);
ve=vt(:,2);
cg(ii)=vg'*psit;
ce(ii)=ve'*psit;
end;
Error:
Error using odearguments (line 90)
SCHROE must return a column vector.
Error in ode45 (line 115)
odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in lz_2level_simu_lt (line 27)
[ttotal, ytotal] = ode45(@schroe, tt, y0, options);
Please Help
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Ordinary Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!