Simulation of the trajectory of a particle in electric and magnetic field (electromagnetic field). The trajectory is calculated by computationally solving differential equations. The direction and magnitude of magnetic and electric field can be changed along with other attributes of motion.
This simulation can be used in teaching for explaining the motion of particle in electromagnetic field.
This simulation has been developed under guidance of prof KG Suresh, Phy dep, IITB.
I have used a ode23 differential equation solver in the .m file.
y0 = [r0; v0];
f = @(t,y) [y(4:6); (q/m)*cross(y(4:6),B)+E];
[t,y] = ode23t(f,tspan,y0);
So I cannot find how you calculate the trajectory, and how you solve the differential equation. In which part do you do the calculations?
This has been developed under the guidance of prof KG Suresh, Phy dept, IITB