def test_normalization_time(): ut = 10 tmin = 0 tmax = 100 int0 = integrate.quad( lambda t: qtdmri.qtdmri_temporal_normalization(ut)**2 * qtdmri. temporal_basis(0, ut, t) * qtdmri.temporal_basis(0, ut, t), tmin, tmax)[0] int1 = integrate.quad( lambda t: qtdmri.qtdmri_temporal_normalization(ut)**2 * qtdmri. temporal_basis(1, ut, t) * qtdmri.temporal_basis(1, ut, t), tmin, tmax)[0] int2 = integrate.quad( lambda t: qtdmri.qtdmri_temporal_normalization(ut)**2 * qtdmri. temporal_basis(2, ut, t) * qtdmri.temporal_basis(2, ut, t), tmin, tmax)[0] assert_almost_equal(int0, 1.) assert_almost_equal(int1, 1.) assert_almost_equal(int2, 1.)
def test_orthogonality_temporal_basis_functions(): # numerical integration parameters ut = 10 tmin = 0 tmax = 100 int1 = integrate.quad( lambda t: qtdmri.temporal_basis(1, ut, t) * qtdmri.temporal_basis( 2, ut, t), tmin, tmax) int2 = integrate.quad( lambda t: qtdmri.temporal_basis(2, ut, t) * qtdmri.temporal_basis( 3, ut, t), tmin, tmax) int3 = integrate.quad( lambda t: qtdmri.temporal_basis(3, ut, t) * qtdmri.temporal_basis( 4, ut, t), tmin, tmax) int4 = integrate.quad( lambda t: qtdmri.temporal_basis(4, ut, t) * qtdmri.temporal_basis( 5, ut, t), tmin, tmax) assert_almost_equal(int1, 0.) assert_almost_equal(int2, 0.) assert_almost_equal(int3, 0.) assert_almost_equal(int4, 0.)
def test_orthogonality_temporal_basis_functions(): # numerical integration parameters ut = 10 tmin = 0 tmax = 100 int1 = integrate.quad(lambda t: qtdmri.temporal_basis(1, ut, t) * qtdmri.temporal_basis(2, ut, t), tmin, tmax) int2 = integrate.quad(lambda t: qtdmri.temporal_basis(2, ut, t) * qtdmri.temporal_basis(3, ut, t), tmin, tmax) int3 = integrate.quad(lambda t: qtdmri.temporal_basis(3, ut, t) * qtdmri.temporal_basis(4, ut, t), tmin, tmax) int4 = integrate.quad(lambda t: qtdmri.temporal_basis(4, ut, t) * qtdmri.temporal_basis(5, ut, t), tmin, tmax) assert_almost_equal(int1, 0.) assert_almost_equal(int2, 0.) assert_almost_equal(int3, 0.) assert_almost_equal(int4, 0.)
def test_normalization_time(): ut = 10 tmin = 0 tmax = 100 int0 = integrate.quad(lambda t: qtdmri.qtdmri_temporal_normalization(ut) ** 2 * qtdmri.temporal_basis(0, ut, t) * qtdmri.temporal_basis(0, ut, t), tmin, tmax)[0] int1 = integrate.quad(lambda t: qtdmri.qtdmri_temporal_normalization(ut) ** 2 * qtdmri.temporal_basis(1, ut, t) * qtdmri.temporal_basis(1, ut, t), tmin, tmax)[0] int2 = integrate.quad(lambda t: qtdmri.qtdmri_temporal_normalization(ut) ** 2 * qtdmri.temporal_basis(2, ut, t) * qtdmri.temporal_basis(2, ut, t), tmin, tmax)[0] assert_almost_equal(int0, 1.) assert_almost_equal(int1, 1.) assert_almost_equal(int2, 1.)