# Valis¶

Valis are design parameters of components or analyses which can be used in calculations and documentation. A Vali has a numerical value and also contains additional information such as type, unit, formula, description and min/max requirements.

You can access a Vali in any text field by starting to type a '$' sign and you will get a list of all existing Valis to choose from.

## Create Valis¶

You can create Valis in a component by filling in a name (should be a type name for Valis with a type), a formula and a unit in the top form and hitting 'Save'.

You can see more information about the Vali by clicking on the arrow to the left of the name.

Any text or number that is underlined is editable. Just click on the text/number to change the value.

## Formula¶

A Vali can be calculated with a formula using common mathematical expressions. A formula can also contain other Valis.

You can either

- use a fixed value, such as
`42.7`

- use a formula, such as
`5/(3+17.3*9)`

- use other Valis, using the
`$`

sign:`$car.speed+5`

Start typing a `$`

to get a list of all available Valis.

You can also use any of the following properties of a Vali in a formula with a backslash, `\`

:

`$car.speed\max`

- Maximum requirement`$car.speed\min`

- Minimum requirement`$car.speed\margin_plus`

- Positive margin`$car.speed\margin_minus`

- Negative margin`$car.speed\wc_plus`

- Higher worst case (value + positive margins)`$car.speed\wc_minus`

- Lower worst case (value + negative margins)

Math operations available in formulas are:

`+`

,`-`

,`*`

,`/`

`^`

`sqrt()`

`exp()`

`log10()`

,`ln()`

`sin()`

,`cos()`

,`tan()`

`soc()`

="Sum of children": sum of all Valis of the same type in subcomponents

You can also use the following logical functions in formulas:

`if(condition, formula_if_true, formula_if_false)`

`max(formula1, formula2)`

`min(formula1, formula2)`

Valispace custom formulas:

`sum_of_children()`

or`soc()`

: sums up all the Valis of the same type in the components one level below`average_of_childre()`

or`aoc()`

: calculates the average value of the Valis of the same type in the components one level below`average_of_datasets()`

or`aod()`

: the result of the Vali is the average for each point of the datasets belonging to that Vali. If there is only one dataset, that dataset is the result and is used in further calculations`sum_of_datasets()`

or`sod()`

: the result of the Vali is the sum for each point of the datasets belonging to that Vali. If there is only one dataset, that dataset is the result and is used in further calculations

Example formulas:

`$SolarPanel.width * $SolarPanel.length`

`max(soc(), $SolarPanel.lowest_mass)`

`if($SolarPanel.width*2 > $SolarPanel.length, 10, 5)`

## Matrix¶

A matrix is a group of individual Valis ordered in rows and columns. To add a matrix, choose 'add matrix' in the dropdown and fill in the fields.

## History¶

When a Vali is changed its previous state is saved in a history. The evolution of a Vali can be seen in the history graph:

## Notifications on changes¶

To get a notification when a certain Vali changes, you can subscribe to it by clicking on the subscribe button to the right of the Vali.

You will see a new notification in the navigation bar when someone has changed a value you are subscribing to.