## Breach doc: Simulations

The first thing one wants to do with a dynamical system is computing
its evolution over time given some values for its initial conditions
and various parameters. In Breach, this is done using the
**ComputeTraj** command. It takes three arguments:

- A system
`Sys`

, obviously corresponding to the dynamical system under study - A Parameter set
`P`

, which is a structure assigning values to parameters of the system - A time specification
`time`

, which indicates the time instants for which we want to compute the state of system.

### Computing the nominal trajectory

The system structure `Sys`

contains nominal (or default) values for
the system parameters. To compute a trajectory corresponding to these
nominal parameters, we can obtain the corresponding nominal parameter
set by using the CreateParamSet routine. The example below shows how
to do it for the Lorentz example (in Examples/Lorentz folder):

%% Init system and parameter set (create the Sys structure) CreateSystem; %% Create nominal parameter set P0 = CreateParamSet(Sys); %% Compute nominal trajectories and output result for t in [0 10] with time step .01 time = 0:.01:10; Pf = ComputeTraj(Sys, P0, [0 10);

To plot the result, one can use two different routines. **SplotTraj**
plots the result in the phase space (in this case, in the space
\((x_0,x_1, x_2)\).). The code

SplotTraj(Ptraj)

produces:

**SplotVar** plots each variable of the simulation
against time. Below is the output of

SplotVar(Ptraj)