Hello everyone,
Hello everyone,
I have a function in the first row of a result matrix, and also in the 
second. 

I'm separating the first row to write only the parts of it into a new 
matrix, for example, a multiplication by the second derivative of phi1. 
[image: pic_result matrix.jpg]

Unfortunately, there's no result, just square brackets. Can anyone help? 
Thanks in advance.

*Sympy Code:*
#Testmatrix 
C = d*sp.diff(phi1(t), 
t)+l*m*(2*g*sp.sin(phi1(t))+l*sp.sin(phi1(t)-phi2(t))*(sp.diff(phi2(t), 
t))**2+ l*sp.cos(phi1(t)-phi2(t))*sp.diff(phi2(t), t,t)+ 
2*l*sp.diff(phi1(t), t,t))
D = sp.diff(phi2(t), t) + sp.diff(phi1(t), t)

Bw_Lag_Q_Test = sp.Matrix([[C], [D]])
Bw_Lag_Q_Test

erste_reihe_BW_Test = Bw_Lag_Q_Test.row(0)
erste_reihe_BW_Test

# Extract parts of  erste_reihe_BW_Test
erste_reihe_BW_Test = Bw_Lag_Q_Test.row(0)
Extract_0 = [term.coeff(sp.diff(phi1(t), t,t)) for term in erste_reihe_BW 
if term.has(sp.diff(phi1(t), t,t))]
Extract_0
[image: pic_empty square bracket.jpg]

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/sympy/53ab1baa-d5ad-4c03-b02d-6a55b8358ba0n%40googlegroups.com.

Reply via email to