I wrote some code to simulate the trajectory of an object through a grossly simplified version of the solar system. It uses the ordinary differential equation solver that comes with Matlab, some Newtonian physics, only has the Sun, Earth and Moon, and only uses idealized, circular orbits for those. The code is here in this github repository:
Update - important note: I have subsequently learned about the problem of energy drift which is when using basic differential equation solvers on even simple Newtonian systems, the result will have the system's energy increasing over time - sometimes even exponentially! There are another class of differential equation solvers (Verlet Integration, Sympletic Integrator) that address this problem, the solar system trajectory code above should be updated to use these instead.