JacquesCarette / Drasil

Generate all the things (focusing on research software)
https://jacquescarette.github.io/Drasil
BSD 2-Clause "Simplified" License
142 stars 26 forks source link

Add functions to display other forms in NewDEModel #2877

Open cd155 opened 2 years ago

cd155 commented 2 years ago

There are multiple forms of ODE.

  1. The standard form is ax0 + bx1 + cx2 + .... + contant = 0.
  2. It could be ax0 + bx1 + cx2 + .... = contant. This is applied in NoPCM, which puts the constant term on the right-hand side.

In the #2875 , we created a NewDEModel. However, there is no way to set the display form to other forms. Currently, the NewDEModel will have an express in the canonical form. In this ticket, add functions to set express to other types of forms.

We can ask users to input which type they want the express to display.

For example, giving a new data type as an input

data DisplayType = Canonical | Constant
cd155 commented 2 years ago

The ODE exists in many forms, and we want to add more displaying variability. Currently, the DifferentialModel display the single ODE in a "one-equation" form,

Screen Shot 2022-09-19 at 12 10 58 PM

It is capable of displaying the ODE in a matrix form; there is the demo.

Screen Shot 2022-09-19 at 12 12 15 PM

The reason we display the single ODE in "one-equation" form is because it is over-complicated to display the matrix form for the single ODE.

Another example of displaying is moving all the terms to the left-hand side and leaving the right-hand side to 0. (did not implement)

Screen Shot 2022-09-19 at 12 17 40 PM