The Jupyter notebook cheat sheet

This document will be available to you during tests and exams

Numeric

Basic plotting functions

Symbolic manipulation

Imports

Symbol definitions

Example controller and system

Working with rational functions and polynomials

We often want nice rational functions, but sympy doesn't make expressions rational by default

The cancel function forces this to be a fraction. collect collects terms.

In some cases we can factor equations:

Obtain the numerator and denominator:

If you want them both, you can use

Convert to polynomial in s

Once we have a polynomial, it is easy to obtain coefficients:

Calculate the Routh Array

To get a function which can be used numerically, use lambdify:

Functions useful for discrete systems

Write in terms of positive powers of zz:

Write in terms of negative powers of zz:

Inversion of the zz transform

Equation solving

Symbolic

Numeric sympy

Numeric

Matrix math

Symbolic

Creation

Determinant, inverse, transpose

Math operations: Multiplication, addition, elementwise multiplication:

Numeric

Creation

Determinant, inverse, transpose

Math operations: Multiplication, addition, elementwise multiplication: