My Input:
syms x(t) y(t) z(t)%Units of kg and seconds
q = 1.60217662*(10^-19);B = 2;m_e = 1.60217662*(10*-31);a = (q*B)/m_e;%DiffiQ to solve
ode1 = diff(x,2) == a*diff(y);ode2 = diff(y,2) == -a*diff(x);ode3 = diff(z,2) == 0;odes = [ode1; ode2; ode3];%Solutions
S = dsolve(odes);xSol(t) = S.x;ySol(t) = S.y;zSol(t) = S.z;[xSol(t), ySol(t), zSol(t)] = dsolve(odes);%Initial Conditions
condx1 = x(0) == 1;condy1 = y(0) == 1;condz1 = z(0) == 0;%{
condvx1 = diff(x) == 1;condvy1 = diff(y) == 2;condvz1 = diff(z) == 2;%}
%Plot Trajectory
t = 0:pi/50:8*pi;plot3(ode1,ode2,ode3,'r','LineWidth',3)
My Output: Nothing. The program runs but nothing happens. I have to force close MatLab so that the script stops. I left it running for an hour to see but I am starting to think that there is another issue. Any advice is appreciated!
PS – Using Matlab R2018a and yes I purposefully commented out a section of initial conditions.
Best Answer