Code

Core functions

The core functions perform the SALR particle clustering: setting up the problem, modeling particle dynamics, and enabling straight forward parameter selection.

Below is a listing of the core functions along with a short description and an example of how to call the function. For details about each function, use the Matlab help command.
Ex: help modelParticleDynamics

extractClusterCenters():
Extract the center and the number of particles in particle cluster.
[clusterCenters, clusterSize] = extractClusterCenters(r_final,options)
interactingParticleSystem():
Compute the change in particle states dy=[dr/dt, dp/dt] from the current states y=[r, p].
dy = interactingParticleSystem(t,y,extraInputs)
interactingParticleSystem_convergeEvent():
Determine if the particle system has converged by checking if the mean particle speed is below some threshold.
[value, isterminal, direction] = interactingParticleSystem_convergeEvent(t,y,m,hstry,D)
modelParticleDynamics():
Model particles confined in potential with gradient dV and initial positions r0 and return their approximate equilibrium positions.
r = modelParticleDynamics(dV,r0,options)
[r, Info] = modelParticleDynamics(dV,r0,options)
ode_history():
A class for storing an ODE solution at previous time steps while solving. Use the history with an ODE 'Events' function to catch more complex behavior than can be determined with only the current solution.
history = ode_history(t0, y0, history_size)