Beispiel #1
0
def derivatives_in_rectangular_coordinates():
    Print_Function()
    X = (x, y, z) = symbols('x y z')
    o3d = Ga('e_x e_y e_z', g=[1, 1, 1], coords=X)
    (ex, ey, ez) = o3d.mv()
    grad = o3d.grad

    f = o3d.mv('f', 'scalar', f=True)
    A = o3d.mv('A', 'vector', f=True)
    B = o3d.mv('B', 'bivector', f=True)
    C = o3d.mv('C', 'mv')
    print 'f =', f
    print 'A =', A
    print 'B =', B
    print 'C =', C

    print 'grad*f =', grad * f
    print 'grad|A =', grad | A
    print 'grad*A =', grad * A

    print '-I*(grad^A) =', -o3d.I() * (grad ^ A)
    print 'grad*B =', grad * B
    print 'grad^B =', grad ^ B
    print 'grad|B =', grad | B
    return
Beispiel #2
0
def derivatives_in_spherical_coordinates():
    Print_Function()

    X = (r, th, phi) = symbols('r theta phi')
    s3d = Ga('e_r e_theta e_phi',
             g=[1, r**2, r**2 * sin(th)**2],
             coords=X,
             norm=True)
    (er, eth, ephi) = s3d.mv()
    grad = s3d.grad

    f = s3d.mv('f', 'scalar', f=True)
    A = s3d.mv('A', 'vector', f=True)
    B = s3d.mv('B', 'bivector', f=True)

    print 'f =', f
    print 'A =', A
    print 'B =', B

    print 'grad*f =', grad * f
    print 'grad|A =', grad | A
    print '-I*(grad^A) =', -s3d.I() * (grad ^ A)
    print 'grad^B =', grad ^ B
    return
Beispiel #3
0
def signature_test():
    Print_Function()

    e3d = Ga('e1 e2 e3', g=[1, 1, 1])
    print 'e3d.g =', e3d.g
    print 'Signature = (3,0) I =', e3d.I(), ' I**2 =', e3d.I() * e3d.I()

    e3d = Ga('e1 e2 e3', g=[2, 2, 2])
    print 'e3d.g =', e3d.g
    print 'Signature = (3,0) I =', e3d.I(), ' I**2 =', e3d.I() * e3d.I()

    sp4d = Ga('e1 e2 e3 e4', g=[1, -1, -1, -1])
    print 'e3d.g =', sp4d.g
    print 'Signature = (1,3) I =', sp4d.I(), ' I**2 =', sp4d.I() * sp4d.I()

    sp4d = Ga('e1 e2 e3 e4', g=[2, -2, -2, -2])
    print 'e3d.g =', sp4d.g
    print 'Signature = (1,3) I =', sp4d.I(), ' I**2 =', sp4d.I() * sp4d.I()

    e4d = Ga('e1 e2 e3 e4', g=[1, 1, 1, 1])
    print 'e4d.g =', e4d.g
    print 'Signature = (4,0) I =', e4d.I(), ' I**2 =', e4d.I() * e4d.I()

    cf3d = Ga('e1 e2 e3 e4 e5', g=[1, 1, 1, 1, -1])
    print 'cf4d.g =', cf3d.g
    print 'Signature = (4,1) I =', cf3d.I(), ' I**2 =', cf3d.I() * cf3d.I()

    cf3d = Ga('e1 e2 e3 e4 e5', g=[2, 2, 2, 2, -2])
    print 'cf4d.g =', cf3d.g
    print 'Signature = (4,1) I =', cf3d.I(), ' I**2 =', cf3d.I() * cf3d.I()

    return
Beispiel #4
0
def signature_test():
    Print_Function()

    e3d = Ga('e1 e2 e3',g=[1,1,1])
    print 'g =', e3d.g
    print r'%Signature = (3,0)\: I =', e3d.I(),'\: I^{2} =', e3d.I()*e3d.I()

    e3d = Ga('e1 e2 e3',g=[2,2,2])
    print 'g =', e3d.g
    print r'%Signature = (3,0)\: I =', e3d.I(),'|; I^{2} =', e3d.I()*e3d.I()

    sp4d = Ga('e1 e2 e3 e4',g=[1,-1,-1,-1])
    print 'g =', sp4d.g
    print r'%Signature = (1,3)\: I =', sp4d.I(),'\: I^{2} =', sp4d.I()*sp4d.I()

    sp4d = Ga('e1 e2 e3 e4',g=[2,-2,-2,-2])
    print 'g =', sp4d.g
    print r'%Signature = (1,3)\: I =', sp4d.I(),'\: I^{2} =', sp4d.I()*sp4d.I()

    e4d = Ga('e1 e2 e3 e4',g=[1,1,1,1])
    print 'g =', e4d.g
    print r'%Signature = (4,0)\: I =', e4d.I(),'\: I^{2} =', e4d.I()*e4d.I()

    cf3d = Ga('e1 e2 e3 e4 e5',g=[1,1,1,1,-1])
    print 'g =', cf3d.g
    print r'%Signature = (4,1)\: I =', cf3d.I(),'\: I^{2} =', cf3d.I()*cf3d.I()

    cf3d = Ga('e1 e2 e3 e4 e5',g=[2,2,2,2,-2])
    print 'g =', cf3d.g
    print r'%Signature = (4,1)\: I =', cf3d.I(),'\: I^{2} =', cf3d.I()*cf3d.I()

    return