pg_utils.pg_model.base_utils.linearize

pg_utils.pg_model.base_utils.linearize(expr, *subs_maps, perturb_var=\epsilon)[source]

Linearize expression

Parameters:
  • expr (sympy.Expr) – expressions to be linearized

  • *subs_maps (dict) –

    subtitution maps, takes the form {A: A0 + eps*A1, B: B0 + eps*B1, ...}

  • perturb_var (sympy.Symbol) – perturbation number, default to be the symbol eps from pg_fields module

Returns:

linearized expression