Evaluating Expressions on Particle/Ray Trajectories
Evaluate expressions on particle trajectories with the function mphparticle and on and ray trajectories with the function mphray.
mphray supports only Ray Trajectories datasets. mphparticle supports both Ray Trajectories and Particle Trajectories datasets.
In this section you can replace the command mphparticle and mphray as they support the same properties.
Evaluate expressions on particle and ray trajectories with either the function mphparticle or mphray.
To evaluate the particle position and the particle velocity run mphparticle as in this command:
pd = mphparticle(model)
pd is a structure containing the information about particle position and particle velocity at every time step. The information is stored in the following fields:
p contains the coordinates of the particle position along the trajectories. The data are stored in a NxMxL array where N is the number of time steps, M the number of evaluation point along the particle trajectories, and L the evaluation space dimension.
v contains the value of the particle velocity along the trajectories. The data are stored in a NxMxL array where N is the number of time steps, M the number of evaluation points along the particle trajectories, and L the evaluation space dimension.
t contains the list of evaluation time.
You can also specify expressions to evaluate along the particle trajectories. Run the function mphparticle as in this command:
pd = mphparticle(model,'expr','e1')
where 'e1' is the expression to evaluate along the particle trajectories. The output structure pd contains the fields p, v, and t (described above) with the following ones:
unit contains the unit of the evaluated expression;
d1 contains the value of the expression. The data are stored in a NxM array where N is the number of time steps and M the number of evaluation points along the particle trajectories; and
expr contains the list of the evaluated expression.
Use a string cell array to evaluate several expressions at once. The result of the evaluation is then stored in the field d1,... corresponding to each evaluated expression.
Specify the Evaluation Data
The function mphparticle supports the following properties to set the data of the evaluation to perform:
dataset, specify the solution dataset to use in the evaluation:
pd = mphparticle(model,'expr',<expr>,'dataset',<dsettag>)
<dsettag> is the tag of a particle solution dataset. The default value is the current particle solution dataset of the model.
pd = mphparticle(model,'expr',<expr>,'t',<time>)
where <time> is a double array. The default value corresponds to all the stored time steps.
Output Format
The function mphparticle also supports other output formats.
Set the property dataonly to on to return only the data related to the specified expression:
pd = mphparticle(model,'expr',<expr>,'dataonly','on')
The output structure pd only contains the field unit, d#, expr, and t (described above).