Considering an existing function written for numerical values, is Simimp has given a suggestion to handle signals ? For example: Import
as np def foo (ax, ay, az): A = NP matrix ([[1, ax, 0], [0, 1 / Back to the Fu (1, 2, 3) # We also want to work as: SPEED-AX imports as a sympege, AE, Ez = spymes ('0'), [0, 0, NP CUSS] Foo (F, AE, AG)
How to extend foo ()
to handle CMP needed? Symbols ax, ay, az
and therefore return a symbolic matrix a
? Are there any facilities to help with this in sympy? Unfortunately you can not control sympy symbols in a numpy function.
Unfortunately you can not control sympy symbols in a numpy function. For a dirty solution, to check the type of variable and decide which function to use. Import
np import as sympy as spy def foo (ax, ay, az): a = np. Matrix ([[1, ax, 0], [0, 1. / Ay, 0], [0, 0], if detective Chaos (es) then detective.Simbol other NP Chaos (az print) foo (ax, ay, az) & gt; print) foo (1, 2, 3) ax, ay, az = spy.symbols ('ax', 'ay', 'az')) Print & gt; & Gt; [[1. 0. 0.] [0. 0.5 0] [0. 0. -0.98 99 925]] [[1.0 ax 0] [0 1.0 / a] [0 cos (az)]]
No comments:
Post a Comment