Drasil
Drasil copied to clipboard
Teach Drasil about ODEs
We need to capture the knowledge of ODES, like in the SWHS and No-PCM examples. Once Drasil knows what an ODE is, the rendering should be fairly straightforward.
This should likely be some kind of structure that lies 'above' Expr
. But something should could still be put into various larger structures (like theories, models, etc).
In the context of #2371, our existing DEModel just contains a RelationConcept inside of it, but I think we want it to be something different since we want to remove as much usage of RelationConcepts as possible, and we want to teach Drasil about ODEs. So I'm now wondering if we have any concrete requirements of what it means to have Drasil sufficiently well-equipped for handling ODEs?
There's also a few other tickets related to this (in particular, I think #2194 is the most directly relevant).
@balacij as we discussed in today's (May 18) group meeting, we don't currently have any concrete requirements for teaching Drasil about ODEs. I take it as a good sign that we are getting to the point where you are asking that question. :-)
Dong Chen (I don't think he is currently a collaborator on Drasil, since I can't find an @ for him) is considering looking at these kind of concrete requirements for his project.
Just noted this ticket to @cd155 on Teams.
@balacij @smiths In #2875, NewDEModel be added to replace the DEModel. The NewDEModel contains DifferentialModel which recaptures the ODE-related information in the IM. DifferentialModel was made based on a linear differential equation
DifferentialModel has
- independent variable
- dependent variable
- coefficients: an input language to mimic the structure of a linear differential equation
- constant
@cd155, thank you for linking this issue to the addition of NewDEModel.
Does NewDEModel also include information on initial values? The general solution for the ODE will introduce unknown constants. To solve for those constants to get an actual solution, we need the initial conditions.
(There is also a related class of ODEs called Boundary Value Problems. Initial Value problems set all of the initial conditions at the initial time, like launching a projectile. Boundary Value Problems set the known values at different locations in space, like solving for the shape of a beam under load, or the temperature in a heated plate.)
@smiths Currently, the NewDEModel doesn't have the initial value, but I can add the initial value on it.
For the case studies, like NoPCM and PDControll,
- NoPCM has an initial value in IM
- PDControll initialize the initial value to
exactDbl 0
.
For adding Boundary Value Problems, I think the current ODE code generator doesn't have related knowledge to solving a Boundary Value Problem.
@smiths Do you think the initial values, initial time and final time are essential to be included in the ODE model? We don't have a precise definition of what is a model.
From my point of view (I could be wrong), the linear differential equation can be a standalone system. Without initial values, initial time and final time, the linear differential equation is still functional. Initial values, initial time and final time are the information needed to solve the problem numerically. That's the reason I haven't added initial values, initial time and final time to the NewDEModel.
@cd155, as we discussed in our meeting (#2957), the initial time (often t = 0) and initial values are necessary to find a particular solution for an ODE. Without the initial value for an IVP, we can only find a general solution, which (as said by @JacquesCarette) is actually a family of solutions. The general solution will include unknown constant(s) that parameterize the solution. To find the specific solution that we need, we need to solve for the constants using the initial values.
You are right that the linear differential equation does standalone, but to get a specific solution, we need the initial value(s). Our examples are all looking for a specific solution, so we will always need the initial values.
@JacquesCarette suggested a constructor for IVPs. I like this idea. The constructor includes the linear differential equation and the initial conditions. Maybe you can keep something like NewDEModel, which will be part of the IVP?