Giter Club home page Giter Club logo

Comments (2)

Richert avatar Richert commented on June 3, 2024

Hi Nina,

thank you for giving PyRates a try and for bringing this to my attention!
Indeed, it is not supported at the moment to save non-state variables as output variables.
The issue with supporting non-state variables is that it leads to compatibility issues with external differential equation solving tools such as scipy.integrate.solve_ivp. These tools require a function that returns only a state-vector which has the same dimensionality as the differential equation system that governs the dynamics.

I have been thinking of a way to include this feature, but have not yet found a way to do it without substantial drawbacks.
At the moment, there are two work-arounds you could use:

(I) Store whatever state-variable you use your wrap function on as an output and manually apply the wrap function after the simulation.

OR

(II) Add an observer state variable to your model that tracks the dynamics of your variable of interest with a small low-pass filtering time constant. If you have a variable wrap, you could include d/dt wrap_obs = (wrap-wrap_obs)/tau_obs, where tau_obs is smaller than any other time constant in your system.

Let me know if I can help any further!

from pyrates.

NinaOmejc avatar NinaOmejc commented on June 3, 2024

Hi,

Ok, thank you for the information. I have been using the first option you mentioned, but as I saw the option to wrap angle theta in sinus function in your exemplary YAML model definition for Kuramoto oscillator, I thought I have missed something.

Thank you also for a quick response!
Best,
Nina

from pyrates.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.