||
%************时间及初值***********% t=0:1:100; x0=0.5,y0=0.5,z0=0.5; vx0=0.01,vy0=1,vz0=1; m=1E-15,q=1E-16; %************粒子轨迹E=0***********% B=1E-2;E=0 x=x0+vx0*t y=m/B*vy0*sin(B/m*t)-m/B*(vz0+E*q/B)*cos(B/m*t)+y0+m/B*(vz0+E*q/B) z=m/B*vy0*cos(B/m*t)+m/B*(vz0+E*q/B)*sin(B/m*t)-E*q/B*t+z0-m/B*vy0 figure(1) subplot(1,3,1); plot3(x,y,z); r=q*B/m/(vx0^2+vy0^2+vz0^2)^(0.5); %************粒子轨迹E&B!=0***********% B=1E-2;E=1; x2=x0+vx0*t; y2=m/B*vy0*sin(B/m*t)-m/B*(vz0+E*q/B)*cos(B/m*t)+y0+m/B*(vz0+E*q/B); z2=m/B*vy0*cos(B/m*t)+m/B*(vz0+E*q/B)*sin(B/m*t)-E*q/B*t+z0-m/B*vy0; subplot(1,3,3); plot3(x2,y2,z2) r2=q*B/m/(vx0^2+vy0^2+vz0^2)^(0.5)
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-26 19:40
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社