from normal_forms import normal_form import sympy import numpy as np from for_plotting import before_and_after # Guckenheimer, Excercise 3.4.5 def f(x, y, mu=0): f1 = y f2 = -mu * y - x + x * x * x return f1, f2 h = normal_form(f, (0, 0), 3) before_and_after(f, h, -2, 2, -2, 2)
}, parnames={ 1: 'p1', 2: 'p2', 3: 'p3' }, U={ 'x': 0, 'y': 0 }, PAR={ 'p1': 0, 'p2': 8, 'p3': 3 }, ICP=['p2'], RL1=14) ab = auto.run(start('EP2'), c='ab.2') ab = auto.rl(ab) auto.sv(ab, 'ab') auto.cl() hb = ab('HB1') p = hb['p1'], hb['p2'], hb['p3'] x = hb['x'][0], hb['y'][0] h = normal_form(f, x, 3, p)
from normal_forms import normal_form import sympy # Murdock, Normal Forms and Unfoldings of Local Dynamical Systems, Example 4.5.24 def f(x, y, z): f1 = 6 * x + x**2 + x * y + x * z + y**2 + y * z + z**2 f2 = 2 * y + x**2 + x * y + x * z + y**2 + y * z + z**2 f3 = 3 * z + x**2 + x * y + x * z + y**2 + y * z + z**2 return f1, f2, f3 h = normal_form(f, (0, 0, 0), 2) # coeff of z**2 print h.fun[0].coeff(h.jet.var[2]**2)
import sympy f = lambda x, r=0: r + 1 - x - sympy.exp(-x) from normal_forms import normal_form h = normal_form(f, x=0, k=2) print h.fun print h(2)