Open bogumilchilinski opened 3 months ago
from dynpy.solvers.linear import ODESystem
from sympy import*
from dynpy.utilities.components.ode.en import MSMComparison
delta = Symbol('delta',positive=True)
eps=Symbol('\\varepsilon')
t = Symbol('t')
x= Function('x')(t)
c=Symbol('c',positive=True)
k=Symbol('k',positive=True)
m=Symbol('m',positive=True)
ode_eq=Eq(m*x.diff(t,2)+c*x.diff(t)+k*x,0)
dict_ode={k:0.1, m:10}
odes = ODESystem(ode_eq.lhs-ode_eq.rhs,dvars=x,ivar=t,ode_order=2).subs(c,eps).subs(dict_ode)
MSMComparison(odes)
The goal is to implement
MSMComparison
component to compare numerical and analytical solutions and plot both of the graphs and a grapph of the difference between them.