import sympy as sm

a, l, t = sm.symbols('a l t')

phi = sm.Function('phi')(t)

dt = sm.Matrix([l*sm.sin(phi), l*sm.cos(phi) + 3*t**2, 0]).diff(t)

dt



Funktionierte bei mir problemlos.

Vielleicht hilft phi = sp.Function(‚phi‘)(t)

 

NB: Besser Du schreibst auf englisch, das können mehr Leute lesen.

 

From: 'nils Frank' via sympy <[email protected]> 
Sent: Wednesday, February 19, 2025 1:20 PM
To: sympy <[email protected]>
Subject: [sympy] Matrix mit Zeitabhängigen Funktionen Partiellableiten

 

Hallo,

Hat jemand eine Idee wie man die folgende Matrix definieren muss damit man Sie 
nach t ableiten kann? 

 

Ich habe Folgenden Code geschrieben und es funktioniert nicht mit  " .diff(t) "

 

import sympy as sp

a = sp.Symbol("a")
t = sp.Symbol("t")
l = sp.Symbol("l")
phi = Function('phi')(t)

from sympy import *
init_printing(use_unicode=True)

r_0p = Matrix([l*sin(phi), a*cos(2*phi)+3*t**2, 0])
r_0p

 

ich möchte nun r_0p nach t ableiten

der Daten Typ der Matrix wird als "sympy.matrices.dense.MutableDenseMatrix" 

 

wenn versuche ich, wie folgt, die Matrix nach t abzuleiten

 

(r_0p_deff = r_0p.deff(t)

r_0p_deff

 

Kommt der Fehler 

AttributeError: 'MutableDenseMatrix' object has no attribute 'deff'  

 

 

 

Bei dem Folgenden Code funktioniert es, auch wenn ich hier die Bedeutung der 
inneren Klammern bei der Ausgabe nicht verstehe.

 

a = Matrix([x*y,z,4*y])
a

 

type(a)

= sympy.matrices.dense.MutableDenseMatrix

 

# leitet die Matrix ab
a_diff = a.diff(r)
a_diff

 

hat jemand eine Idee??

 

 

-- 
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] 
<mailto:[email protected]> .
To view this discussion visit 
https://groups.google.com/d/msgid/sympy/39e25bce-8538-44a1-8f15-9b2e6286e25an%40googlegroups.com
 
<https://groups.google.com/d/msgid/sympy/39e25bce-8538-44a1-8f15-9b2e6286e25an%40googlegroups.com?utm_medium=email&utm_source=footer>
 .

-- 
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/002001db835a%244913a0c0%24db3ae240%24%40gmail.com.

Reply via email to