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

Adding Delay block #19

Closed pjadzinsky closed 5 years ago

masfaraud commented 5 years ago

Hi, do you manage to make it work as expected?

pjadzinsky commented 5 years ago

I think so, I added a test and notes. You do see the proposed changes right?

To be honest, if you expect anyone to contribute you have to be a lot more responsive or add other people to the project.

masfaraud commented 5 years ago

To answer your question why having to evaluate at each time step: you never known what's coming inside the block. In can be something coming from the output of the delay block with a feedback loop. Your remark only works for systems without feedback loops.

The default value is initial value of the input.

I made interpolation to compute the value when the delay value is between two time steps. Now it works with delay as a float in seconds.

I moved your test script in the scripts/tests/blocks folder. The test has to be rewritten, that's why i commented it. Based on this script I made a demo script in scripts/

pjadzinsky commented 5 years ago

Thanks for the answer, I realized what you said after I sent the PR, agreed 100%.

I have more ideas like a convolutional block but more importantly. Can we use PEP8 convention? Your code needs to be put through a pep8 linter.

Thanks Pablo

On Thu, Jan 31, 2019 at 2:34 AM Steven Masfaraud notifications@github.com wrote:

To answer your question why having to evaluate at each time step: you never known what's coming inside the block. In can be something coming from the output of the delay block with a feedback loop. Your remark only works for systems without feedback loops.

The default value is initial value of the input.

I made interpolation to compute the value when the delay value is between two time steps. Now it works with delay as a float in seconds.

I moved your test script in the scripts/tests/blocks folder. The test has to be rewritten, that's why i commented it. Based on this script I made a demo script in scripts/

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/masfaraud/BMSpy/pull/19#issuecomment-459296370, or mute the thread https://github.com/notifications/unsubscribe-auth/AL-EfQvgNwVAGCmme3c3k7npKIXNU6qzks5vIsbTgaJpZM4aEB3a .