# PWA SYSTEM

Piecewise affine discrete-time dynamical system object.

## Contents

Class of the MOBY-DIC toolbox.

## Description

The pwaSystem object describes a piecewise affine discrete-time dynamical system in the form: , being the state variable at time instant and the input variable of the system at the same time instant. The sampling time of the system can also be specified. The dynamics of the system are described by the matrices , and . The state and input variables can be given mnemonic names for a easier comprehension of their meaning. A PWA function (one of the objects available in the toolbox) can be passed as input variable and then the circuit can be simulated and time evolutions of the variables can be plotted.

## Syntax

**pwaSys = pwaSystem()**

Builds an empty pwaSystem object.

**pwaSys = pwaSystem(nx,nu,ndyn)**

Builds a discrete-time piecewise affine system by specifying the number of states (*nx*) and inputs (*nu*). The matrices Ai, Bi and fi are filled with zeros.

## Properties

- nx - number of state variables.
- nu - number of input variables.
- nd - number of system dynamics.
- Ts - sampling time.
- A, B, f - cells containing matrices defining the discrete time PWA system , when .
- H, K - cells containing matrices defining the regions
- xnames - cell array of strings containing the names of the states.
- unames - cell array of strings containing the names of the inputs.

## Methods

- disp - displays some information about the
*pwaSystem*object. - getMatrices - gets the Ai, Bi and f_ matrices defining the PWA system.
- getNumberOfInputs - gets the number of input variables.
- getNumberOfStates - gets the number of state variables.
- getSamplingTime - gets the sampling time of the system.
- setInputNames - allows to give a mnemonical name to the input variables.
- setMatrices - sets the Ai, Bi and fi matrices defining the linear system.
- setSamplingTime - sets the sampling time of the system.
- setStateNames - allows to give a mnemonical name to the state variables.
- sim - simulates the dynamical system.
- simplot - simulates the dynamical system and plots time evolution of states and inputs.

## See also

MOBY-DIC toolbox, pwag, pwas, pwar, pwarApproximation.

## Acknowledgements

Contributors:

- Bart Genuit (b.a.g.genuit@tue.nl)
- Alberto Oliveri (alberto.oliveri@unige.it)

Copyright is with:

- Copyright (C) 2012 Eindhoven University of Technology, The Netherlands.
- Copyright (C) 2010-2011 University of Genoa, Italy.