# Tag Info

0

The method you are using here is Euler-Cromer. It only really works for sytems with two variables (although I guess it could be modified for systems with any even number of variables - e.g. find $x, y, z$ then $vx, vy, vz$). There is a more accurate method, which is more general, but more complicated to program. This is the 4th order Runge Kutta (RK) ...

0

I just discovered: opticalraytracer From the manual: OpticalRayTracer is a free (GPL) cross-platform application that analyzes systems of lenses and mirrors. It uses optical principles and a virtual optical bench to predict the behavior of many kinds of ordinary and exotic lens types as well as flat and curved mirrors. OpticalRayTracer ...

1

I suspect your teacher glanced at it very quickly, and didn't realize you were using timesteps. When you work with timesteps you are doing a discrete approximation of the differential equations which describe the relationships, namely: $\frac{dv}{dt} = a$ and $\frac{dx}{dt} = v$ which in the discrete form, and arranged to match your code, become: $\Delta ... 0 Your solution is correct at the level of your course. We don't see what else is in your code, so there might be another problem. I can only guess what he means by "acceleration / 2". Perhaps he didn't read your program carefully enough; he might have been expecting a solution involving$1/2 a t^2$, and when he didn't see it, moved on. Your solution ... 0$s = v \cdot t$is only true if$v$stays constant. If$v$changes with time, the proper relation is $$s(t) = \int_{t_0}^{t} v(t') \mathrm dt'$$ For$v = a \cdot t$with a constant acceleration$a$this becomes $$s = \frac{1}{2} a t^2$$ So instead of calculating the position from the velocity you could calculate it from acceleration directly. 0 WSxM is free and does this sort of statistics using the "flood" tool. 1 If you want the conceptual answer of what the equations would be for the exact answer, rather than practical numerical rules that approximate the results of the integral, the basic answer is that you first break down each force into components along each coordinate axis ($x$,$y$and$z\$ if you're using Cartesian coordinates), then you add the components of ...

Top 50 recent answers are included