def test_sigma_xy(self):
     self.sigma_xy = Func(
         lambda t, v: ((self.rho * self.sigma_x * self.sigma_y) /
                       (self.alpha_x + self.alpha_y)) *
         (1 - funcs_1d.exp(-(self.alpha_x + self.alpha_y) * (v - t))))
     self.assert_mathcad_python_equal(self.pth('2_sigma_xy'),
                                      self.sigma_xy(self.Time, t=self.t0))
 def test_R2(self):
     self.test_r2_tilde()
     self.test_sigma_star()
     self.test_phi_y()
     self.test_phi_x()
     self.R2 = Func(lambda x, y, t, t1: self.r2_tilde(t1) * funcs_1d.exp(
         self.phi_x(t, v=t1) * x + self.phi_y(t, v=t1) * y - 0.5 * self.
         sigma_star(t, u=t1)))
     self.assert_mathcad_python_equal(
         self.pth('2_R2'),
         self.R2(self.Time, t=self.t0, x=self.x0, y=self.y0))
    def test_r2_tilde(self):
        self.test_r1_tilde()
        self.test_F_xy()

        r2_integrand = Func(lambda t, t1: self.r1_tilde(t1) *
                            (funcs_1d.exp(self.F_xy(0, t1=t1, t2=t)) - 1))
        self.r2_tilde = Func(lambda t: self.r1_tilde(t) * Functional(
            r2_integrand(t=t), x0=0, x1=t, du=True)())
        self.assert_mathcad_python_equal(
            self.pth('2_r2_tilde'),
            [1e3 * a for a in self.r2_tilde(self.Time)])
    def test_f3_prime(self):
        self.test_R1()
        self.test_F_xy()
        self.f3_prime = Func(lambda x, y, t, t2: Functional(Func(
            lambda x, y, t, t1, t2: self.R1(t1, x=x, y=y, t=t) * (funcs_1d.exp(
                self.F_xy(t1, t=t, t2=t2)) - 1))(x=x, y=y, t=t, t2=t2),
                                                            x0=t,
                                                            x1=t2,
                                                            du=True)())

        self.assert_mathcad_python_equal(self.pth('2_f3_prime'), [
            a * 1e3
            for a in self.f3_prime(x=self.x0, y=self.y0, t=self.t0)(self.Time)
        ])
 def test_sigma_yy(self):
     self.sigma_yy = Func(lambda t, v: (pow(self.sigma_y, 2)) /
                          (2 * self.alpha_y) *
                          (1 - funcs_1d.exp(-2 * self.alpha_y * (v - t))))
     self.assert_mathcad_python_equal(self.pth('2_sigma_yy'),
                                      self.sigma_yy(self.Time, t=self.t0))
 def test_phi_y(self):
     self.phi_y = Func(lambda t, v: funcs_1d.exp(-self.alpha_y * (v - t)))
     self.assert_mathcad_python_equal(self.pth('2_phi_y'),
                                      self.phi_y(self.Time, t=self.t0))
 def test_D(self):
     self.test_delta()
     self.D = Func(lambda t, v: funcs_1d.exp(-self.delta(t, v=v)))
     self.assert_mathcad_python_equal(self.pth('2D0'),
                                      self.D(self.Time, t=self.t0))