Esempio n. 1
0
    def test_hessian(self):
        """

        :return:
        """
        doublechameleon = DoubleChameleonPointMass()

        phi_G, q = 0.3, 0.8
        e1, e2 = param_util.phi_q2_ellipticity(phi_G, q)
        kwargs_light = {
            'alpha_1': 1.,
            'ratio_pointmass': 3,
            'ratio_chameleon': 2,
            'w_c1': .5,
            'w_t1': 1.,
            'e11': e1,
            'e21': e2,
            'w_c2': .1,
            'w_t2': .5,
            'e12': e1,
            'e22': e2
        }
        f_xx, f_xy, f_yx, f_yy = doublechameleon.hessian(x=1,
                                                         y=1.,
                                                         **kwargs_light)
        npt.assert_almost_equal(f_xx, 0.0633838122066912, decimal=4)
        npt.assert_almost_equal(f_xy, -0.3986532840628945, decimal=4)
        npt.assert_almost_equal(f_yx, -0.3986532840628945, decimal=4)
        npt.assert_almost_equal(f_yy, 0.04802318253385707, decimal=4)
Esempio n. 2
0
    def test_hessian(self):
        """

        :return:
        """
        doublechameleon = DoubleChameleonPointMass()

        phi_G, q = 0.3, 0.8
        e1, e2 = param_util.phi_q2_ellipticity(phi_G, q)
        kwargs_light = {
            'theta_E': 1.,
            'ratio_pointmass': 3,
            'ratio_chameleon': 2,
            'w_c1': .5,
            'w_t1': 1.,
            'e11': e1,
            'e21': e2,
            'w_c2': .1,
            'w_t2': .5,
            'e12': e1,
            'e22': e2
        }
        f_xx, f_yy, f_xy = doublechameleon.hessian(x=1, y=1., **kwargs_light)
        npt.assert_almost_equal(f_xx, 0.06174422835961879, decimal=4)
        npt.assert_almost_equal(f_xy, -0.5050946519853545, decimal=4)
        npt.assert_almost_equal(f_yy, 0.04438379467671494, decimal=4)
Esempio n. 3
0
    def test_hessian(self):
        """

        :return:
        """
        doublechameleon = DoubleChameleonPointMass()

        phi_G, q = 0.3, 0.8
        e1, e2 = param_util.phi_q2_ellipticity(phi_G, q)
        kwargs_light = {
            'alpha_1': 1.,
            'ratio_pointmass': 3,
            'ratio_chameleon': 2,
            'w_c1': .5,
            'w_t1': 1.,
            'e11': e1,
            'e21': e2,
            'w_c2': .1,
            'w_t2': .5,
            'e12': e1,
            'e22': e2
        }
        f_xx, f_yy, f_xy = doublechameleon.hessian(x=1, y=1., **kwargs_light)
        npt.assert_almost_equal(f_xx, 0.05544254995059526, decimal=4)
        npt.assert_almost_equal(f_xy, -0.49181674712159473, decimal=4)
        npt.assert_almost_equal(f_yy, 0.03985372092386123, decimal=4)