bogumilchilinski / dynpy

MIT License
7 stars 0 forks source link

Reimplementation of `._hom_equation()` method - development of `ODESystem` class #719

Closed bogumilchilinski closed 1 month ago

bogumilchilinski commented 1 month ago

The aim is to reimplement the method providing homogeneous equation in order to suit ._as_fode()

AnnMcCoy commented 1 month ago

Done.

AnnMcCoy commented 1 month ago
from dynpy.solvers.linear import *

x = dynamicsymbols('x')
t = Symbol('t')
h = Symbol('h', positive=True)
omg = Symbol('omega', positive=True)
Omg = Symbol('Omega', positive=True)

ode = ODESystem(odes=Matrix([x.diff(t,t) + 2*h*x.diff(t) + omg**2*x - cos(Omg*t)]), dvars=Matrix([x]), ivar=t, ode_order=2)
ode._hom_equation()._as_fode()