Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] A) Import/Export Weights/Params - and B) Time-dependent functions as a parameter #83

Open
letshin opened this issue Dec 1, 2022 · 3 comments

Comments

@letshin
Copy link

letshin commented Dec 1, 2022

Hi, I have two requests,

1: Is it possible to import/export the weights as a CSV file or something similar so we can share parameters
2: Is it possible to include an input function for a time-dependent perturbation as a parameter. Maybe just a simple function which defaults to y(t) = x. but allows us to add in our own perturbations eg y(t) = sin(t) to perturb the potential as a function of time? Where t is whatever time unit is used for each 'step' of course.

@ker2x
Copy link
Contributor

ker2x commented Dec 1, 2022

the C++ version already have an import/export, I assume you're talking about the js version ?

@KhadrasWellun
Copy link

2: Is it possible to include an input function for a time-dependent perturbation as a parameter. Maybe just a simple function which defaults to y(t) = x. but allows us to add in our own perturbations eg y(t) = sin(t) to perturb the potential as a function of time? Where t is whatever time unit is used for each 'step' of course.

What exactly do you mean by that? Please be more explicit.

@letshin
Copy link
Author

letshin commented Dec 2, 2022

@ker2x Yes, should be. I have been using https://hunar4321.github.io/particle-life/particle_life.html#91651088029.

@KhadrasWellun I would assume that each particle, n has a attraction/repulsion term for each other particle in the simulation let's call these terms n_x (x = 1, 2, 3... n).

For each time step, the position of each particle relative to its nearest neighbours change according to the magnitudes of n_x.

So, there add in a new integer variable, t_angle, which will be defined as the number of time steps for a single revolution (ie 2pi).

Then, add in another variable which is the equation input that is a function of t_angle, lets call this eq_in(t_angle).

Create a lookup table for eq_lookup = [t_angle, eq_in] for all values of t_angle.

Now let n_x * eq_loopup[n], n = 1, 2, 3... t_angle(max) and loop back to n =1 when n = t_angle(max).

This way, the attractive and repulsive forces can be multiplied by a time-dependent variable, e.g. a sine wave term or other more complex wavefunctions. The equation can be input through the GUI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants