CIFASIS / qss-solver

Modeling and simulation tool for continuous and hybrid systems.
GNU General Public License v3.0
28 stars 6 forks source link

Allow user function derivative definition for user defined functions. #60

Open joaquinffernandez opened 4 years ago

joaquinffernandez commented 4 years ago

See definition of: https://www.modelica.org/documents/ModelicaSpec34.pdf#%5B%7B%22num%22%3A177%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C54%2C713%2C0%5D Also, must work for the old version on GQLynk functions.

joaquinffernandez commented 4 years ago

Proposed implementation: 1- Add generic defs and register in Ginac interface for functions with different number of parameters (perhaps up to 10), the first parameter if each function should be an ex that contains the proper function name. 2- Add the derivative name to an internal dict that can be replaced each time the actual function is called. 3- In the ginac2mmo translation, the proper function derivative name should be replace, after this point, everything should be equal to a normal expression handling and printing.