You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a user, I like to change certain values during the course of the integration, using feedback from the integration. Consider a light sail in form of a reflective sphere which may change its reflectivity (the beta value). When it gets closer to the star, it increases reflectivity, and vice versa. If beta can be adjusted during the run, depending on the distance between two objects, interesting trajectories can be simulated.
One may take this further and also modify parameters such as the mass of a body. This is already possible using a given (set once and forget) function, as shown in the example "ModifyMass.ipynb". However, it appears not to be possible to change mass or luminosity depending on external conditions.
The text was updated successfully, but these errors were encountered:
It depends on whether the timescale on which you change the strength of radiation pressure is long compared to the dynamical timescale. It sounds like this is not your case, but for completeness, in this case, you could simply update beta between a grid of times. If the grid is fine on the timescale you want to vary beta you’ll capture the right behavior, and if it’s coarse on the scale of the integrator timestep, you won’t lose any performance. For example to vary beta linearly from 0 to 1 over 1e4 time units:
t_vary = 1e4
Ntimes = 1000
times = np.linspace(0, t_vary, Ntimes)
for time in times:
sim.integrate(time)
sim.particles[1].params[‘beta’] = time/t_vary
If on the other hand you need to vary it on orbital timescales, you would need to write your own custom function. You can follow the example here: https://github.com/dtamayo/reboundx/blob/master/ipython_examples/Custom_Effects.ipynb, where you would write a function like starkForce, that in addition to adding the appropriate acceleration (you could translate the implementation in src/radiation_forces.c) updates the beta parameter of the particles. You can also add new parameters to the particles that control how the effect varies with time to each particle and access them in that function.
When you do this, it means that this function you write will be called in Python every timestep from C, which will slow things down by a factor of a couple to a few. For presumably short integration timescales for light sails the performance might not be an issue you care about. If you need to squeeze out extra performance, you could write your custom effect in C that updates particle accelerations, and then REBOUNDx will automatically take care of all the interface so that it’s accessible from Python. A tutorial on how to do that is here: http://reboundx.readthedocs.io/en/latest/add_effect.html
As a user, I like to change certain values during the course of the integration, using feedback from the integration. Consider a light sail in form of a reflective sphere which may change its reflectivity (the beta value). When it gets closer to the star, it increases reflectivity, and vice versa. If beta can be adjusted during the run, depending on the distance between two objects, interesting trajectories can be simulated.
One may take this further and also modify parameters such as the mass of a body. This is already possible using a given (set once and forget) function, as shown in the example "ModifyMass.ipynb". However, it appears not to be possible to change mass or luminosity depending on external conditions.
The text was updated successfully, but these errors were encountered: