def __init__(self): super(HasTraits, self).__init__() # Initialize solver with the given parameter values self.me = pymexp.Mexp(phi1 = self._phi, phi2 = self._phi, varphi = self._varphi, k0_1 = self._k0, k0_2 = self._k0, c0_A = self._c0, c0_B = self._c0, L0_A = self._L0_A, L0_B = self._L0_B, rho = self._rho, xi = self._xi, mu = self._mu, zeta = self._zeta, psi = self._psi, chi = self._chi, gamma0 = self._gamma0, gamma1 = self._gamma1, gamma2 = self._gamma2, q0 = self._q0, q1 = self._q1, X1 = self._X1)
import numpy as np import pymexp import basicplot3d as p3d # ************************************************************************ # Setup solver me = pymexp.Mexp() me.set_baseline() # ************************************************************************ # Generate data k_max = me.pars.k0_1 d = 32j xdata, ydata = np.mgrid[0.01:0.99:d, 0.01:0.99:d] Omega = np.vectorize(lambda x, y, n: me.objectives_p(x, y)[n]) Nimp = np.vectorize(lambda x, y: me.N_star(me.k_dags_impacted_p(x, y)[0])) OmegaAdata = Omega(xdata, ydata, 2) OmegaBdata = Omega(xdata, ydata, 3) OmegaCdata = OmegaAdata + OmegaBdata Nimpdata = Nimp(xdata, ydata) # ************************************************************************ # Setup plot parameters # 3D view angles, rotation around z axis (azimuth) and elevation above # xy-plane: