Giter Club home page Giter Club logo

Comments (4)

Shanka123 avatar Shanka123 commented on August 17, 2024

Apart from parameters nodes also have stateful parameters whose values are associated with a function and evolves with time as the graph is evaluated.
.
A stateful parameter has the following components:

  1. id
  2. default initial value to start with
  3. value updated by a MDF function that uses the previous value of the stateful parameter, time increment (dt)

Initial work on this here: https://github.com/ModECI/MDF/tree/stateful_parameter

Initial thoughts on implementing the translator:

  1. Input should be any json file with implementation of states.
  2. Extract the parameters / arguments from the expression of time derivative, parameters field of the nodes.
  3. Create a new MDF function using the expression of time derivative for each state, extracted arguments.

from mdf.

jdcpni avatar jdcpni commented on August 17, 2024

from mdf.

Shanka123 avatar Shanka123 commented on August 17, 2024

Translator has been implemented and tested successfully. Translator converts files with state if it contains to file with stateful parameters, otherwise unchanged. The output file upon evaluation produces the same results.
Steps to implement translator

  1. import the original json file to be translated
  2. if node object has states and time derivative then add 'dt' to the parameters of the node object and add 'time' as a stateful parameter
  3. create functions for time_derivative expression for each state variable
  4. Replace all names containing states into stateful_parameters
  5. While evaluating the graph of the translated version, add the corresponding MDF functions

file location: src/modeci_mdf/full_translator.py
currently on branch 'stateful_parameter': https://github.com/ModECI/MDF/blob/stateful_parameter/src/modeci_mdf/full_translator.py

from mdf.

pgleeson avatar pgleeson commented on August 17, 2024

Translator code merged

from mdf.

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.