zxh = Matrix([[-sin(A)*sin(INC)], [cos(A)*sin(INC)], [0]])********************************At this point, I want to unitize 'zxh' so that the sin(INC) divides out. This is a legitimate step since the range of INC is restricted to 0 to \pi and the sin(INC) is always non-negative (I am ignoring the singularities on the boundaries of 0 and \pi). I tried the following but I get the errors below. Some help in coaxing sympy to do what I know can be done would be appreciated.********************************mag2_zxh = trigsimp(zxh.dot(zxh))-> gives sin**2(INC)mag_zxh = sqrt(mag2_zxh)-> gives sqrt(sin(INC)**2)zxh/mag_zxh-> gives Matrix([[-sin(A)*sin(INC)/sqrt(sin(INC)**2)], [sin(INC)*cos(A)/sqrt(sin(INC)**2)], [0]])********************************How can I coax sympy into recognizing that "sin(INC)/sqrt(sin(INC)**2) = 1"?Thanks for any help,Conrad Schiff, PhDProfessor of PhysicsCapitol Technology University
I guess sympy does not know that INC is real and sin(INC) > 0.
I just tried:
INC = sm.symbols(‘INC’, real=True)
test = sympy.Abs(sympy.sin(INC)) / sympy.sqrt(sympy.sin**2(INC))
test = 1 was the result, as expected
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/sympy/CH3PR12MB943223CD74108121BFEDA1D9CFE62%40CH3PR12MB9432.namprd12.prod.outlook.com.
Dear Conrad,
I have never seen this range restriction – but then again I use mostly a sub library of sympy, called sympy.physics.mechanics (to set up symbolic equations of motion of multibody systems), so I am no sympy expert at all!
Maybe you could ask your question here, too:
https://github.com/sympy/sympy
Peter
To view this discussion visit https://groups.google.com/d/msgid/sympy/CH3PR12MB94323D11F41B3E23B7BC605CCFE12%40CH3PR12MB9432.namprd12.prod.outlook.com.
To view this discussion visit https://groups.google.com/d/msgid/sympy/LV8PR12MB9418A0001A666BC3597C1940CFE12%40LV8PR12MB9418.namprd12.prod.outlook.com.
To view this discussion visit https://groups.google.com/d/msgid/sympy/LV8PR12MB9418A0001A666BC3597C1940CFE12%40LV8PR12MB9418.namprd12.prod.outlook.com.