I was wanting to create a physics simulation, in which the initial values would be the initial position vectors of all the bodies, the initial velocity vectors of all the bodies, the masses of all the bodies, the charges of all the bodies, and 0 for the initial time passed.
The distance formula for calculating the distance between two bodies in the simulation should be the same as the distance formula in euclidean space.
The force vector on any body from any other body would depend on the product of the charges of both bodies multiplied by a function of the distance f(distance) between both bodies multiplied by (the position vector of that body minus the position vector of the other body) divided by the distance between both bodies. The total force vector on any body would depend on the sum of all the force vectors on that body from the other bodies. The acceleration vector for any body would depend on the total force vector on that body divided by the mass of that body.
In each time step after the initial time step the new position vector for each body would depend on 1/2 multiplied by the previous acceleration vector multiplied by the previous time step squared plus the previous velocity vector multiplied by the previous time step plus the previous position vector. The new velocity vector would depend on the previous acceleration vector multiplied by the previous time step plus the previous velocity vector. Also the new time passed would depend on the previous time passed plus the previous time step.
The formulas need to automatically adjust to continue matching what I said previously if I change the number of dimensions, add a new body, remove an existing body, change the mass of an existing body, change the charge of an existing body, change the position vector of an existing body, change the velocity vector for an existing body, or change the function of distance in the formula for force that I mentioned earlier.
The simulation should work in more than three dimensions of space. Also for the function of distance f(distance) that I mentioned in paragraph three the simulation should support as many functions of distance as possible including trigonometric functions of the distance such as the sin(distance) and cos(distance) of the distance, hyperbolic trig functions of the distance such as cosh(distance) and sinh(distance) polynomials of the distance, powers of the distance such as e^distance, logarithms of the distance, Bessel functions of the distance, the error function of the distance, and combinations of these functions and if possible other functions.
Ideally it should be possible for the simulation to run through millions of time steps per minute in order for the simulation to be fast while minimizing the accumulated errors in the calculations of the simulation.
How would I code a physics simulation that follows all of my criteria above and what type of program would be best for this type of simulation?