How can I make a surface plot for the ODE solution for different constants z?
w = 1; k=1;figuretspan = [0 5];for z=0.1:0.01:0.5 f = @(t,x) [-1i.*(2*w + 2*z).*x(1) + -1i.*sqrt(2).*k.*x(2);-1i.*sqrt(2).*k.*x(1) + -1i.*2*w*x(2)+-1i.*sqrt(2).*k.*x(3);-1i.*sqrt(2).*k.*x(2)+-1i.*2*w*x(3)];[t,xa] = ode45(f,tspan,[0 1 0]);gs = abs(xa).^2;surf(t,z,gs(:,2))end
Best Answer