# PS Math Function

Apply mathematical function to input physical signal

**Libraries:**

Simscape /
Foundation Library /
Physical Signals /
Functions

## Description

The PS Math Function block applies a mathematical function
to the value and unit of the input physical signal, *u*. The block output is
the result of the operation of the function on the input. You can select one of the following
functions from the **Function choice** parameter list.

Function | Description | Mathematical Expression |
---|---|---|

`sin(u)` | Sine | sin(u) |

`cos(u)` | Cosine | cos(u) |

`exp(u)` | Exponential | e^{u} |

`log(u)` | Natural logarithm | ln(u) |

`10.^u` | Power of base 10 | 10^{u} |

`log10(u)` | Common (base 10) logarithm | log(u) |

`u.^2` | Power 2 | u^{2} |

`sqrt(u)` | Square root | u^{0.5} |

`1./u` | Reciprocal | 1/u |

`tanh(u)` | Hyperbolic tangent | tanh(u) |

`u.^v` | Power | u^{v} |

The PS Math Function block issues a simulation-time error
when the input falls out of the expected domain for the particular function used. For example,
if set to `sqrt(u)`

, the PS Math
Function block issues an error if it receives negative input during
simulation.

**Note**

For `u.^2`

, `sqrt(u)`

,
`1./u`

, and `u.^v`

the unit of the
output signal is the result of the operation of the function on the input signal unit. Thus
for `u.^v`

, unless the input signal is unitless, changing the value
of **v** changes the unit of the output signal. For all other functions in
the list, the input signal must be unitless.

## Examples

## Ports

### Input

### Output

## Parameters

## Extended Capabilities

## Version History

**Introduced in R2007b**