masfaraud / BMSpy

Python Block-Model Simulator. An alternative to simulink in python.
GNU Lesser General Public License v3.0
222 stars 36 forks source link

Calculus functions #13

Closed ericonr closed 6 years ago

ericonr commented 6 years ago

Wow, great work! Models I want to run make use of differentiation and integration blocks, and I couldn't find them. Adding them would be very interesting. I made a fork of the project and plan to work on it when I have a better understanding of your code.

ericonr commented 6 years ago

Also, what exactly does the ODE block do? I couldn't find anything online that matched its behavior.

masfaraud commented 6 years ago

ODE means ordinary differential equation, in a form of two polynoms a and b

    a,b are vectors of coefficients such as H, the transfert function of
    the block, may be written as:
    H(p)=(a[i]p**i)/(b[j]p**j) (Einstein sum on i,j)
    p is Laplace's variable 

if you put a=[1], b=[0,1] you are doing an integration, wit a=[0,1] b=[1] you are doing the opposite, a differentiation