Errors when solving a system of ODEs

12 views
Skip to first unread message

Moe

unread,
Jul 7, 2025, 9:46:14 AMJul 7
to sympy
Greetings,


_____________________
from sympy import *

r=Symbol('r')
A=Function('A')(r)
B=Function('B')(r)

A1 = Derivative(A, r)
B1 = Derivative(B, r)

#eqs = [Eq(A*B, 0), Eq(B, 0)] #line1
#sol = dsolve(eqs, [A, B]) #line2

#eqs = [Eq(A1*B1, 0), Eq(A*B-1, 0)] #line3
#sol = dsolve(eqs, [A, B]) #line4

#eqs = [Eq(A1-B, 0), Eq(B1-B, 0)] #line5
#sol = dsolve(eqs, [A, B]) #line6

#print(sol)
_____________________

When I uncomment lines 1&2, I get an error:
File "C:\...sympy\solvers\ode\systems.py", line 2097, in dsolve_system
    t = list(list(eqs[0].atoms(Derivative))[0].atoms(Symbol))[0]
IndexError: list index out of range

When I uncomment lines 3&4, I get an error:
KeyError: Derivative(B(r), r)

When I uncomment lines 5&6, I don't get an error.

Are these errors bugs?
Reply all
Reply to author
Forward
0 new messages