Error using ode arguments (line 90) SCHROE must return a column vector?
Show older comments
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
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!