JacquesCarette / Drasil

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

Appending missing information to the Drasil side of the Documentation #578

Open elwazana opened 6 years ago

elwazana commented 6 years ago

As was noticed in issue https://github.com/smiths/swhs/issues/33 in the swhs repository, there appears to be missing information in the documentation, as per https://github.com/smiths/swhs/issues/50#issuecomment-394829890. I've fixed that over in the manual version of the docs, and I've started trying to fix them here in Drasil in a separate branch missingInfo.

However, I ran into a problem trying to append a sentence to the end of an equation.

Should be: image

Stable has: image

The problem is that the Data Definitions in SWHS in Drasil are defined as of type QDefinition, which doesn't take a sentence only a QuantityDict, an Expr, a References, and a Derivation. This may be a design issue in the way DataDefs are actually defined. The issue may be related to this comment in the DataDefs.hs file: image

smiths commented 6 years ago

@elwazana, if it helps, I have no objection to the Ap information being given in the Description. It doesn't have to be part of the Equation.

elwazana commented 6 years ago

@smiths That's what I originally thought might fix the problem, but from what @niazim3 and I looked through, the description portion of the Data Definitions seems to be automatically generated based upon the symbols that are used in the equation. So I'm not sure if I should wait for @szymczdm and @JacquesCarette cause that seems more their side of work?

smiths commented 6 years ago

This is what I was afraid of. The equations have more information associated with them than just their symbols. Yes, we will have to speak with @szymczdm and @JacquesCarette. For instance, we need to capture information about the derivation of equations and about the assumptions that are required for their validity. There may be a better place to put this information, but it has to go somewhere.

smiths commented 6 years ago

We have independently discovered the same problem as @szymczdm mentions in issue #522. At least we are updating the manual version so that this information will not be lost while we sort out the challenge of adding it to the GD.

szymczdm commented 6 years ago

Alright, looks like we need to modify the design a bit. This information should be captured as it is extremely relevant, yet it's not "usable" information right now. This leads me to believe the relevant pieces are missing somewhere "higher up the chain", so to speak.

elwazana commented 6 years ago

Documentation of missing information cases

  1. Must add ", over area Ac" to the equation (or description) of dd1HtFluxC

  2. Must add assumptions back into description of dd1HtFluxC for the derivation https://github.com/JacquesCarette/Drasil/blob/0e8d5f103a6839ff10e5c8e7ac25b4948202e829/code/Example/Drasil/SWHS/DataDefs.hs#L27-L28

  3. Must add assumptions into the description of dd2HtFluxP https://github.com/JacquesCarette/Drasil/blob/0e8d5f103a6839ff10e5c8e7ac25b4948202e829/code/Example/Drasil/SWHS/DataDefs.hs#L35-L36

  4. Missing constraint (0 < \phi < 1) in the equation of dd4MeltFrac https://github.com/JacquesCarette/Drasil/blob/0e8d5f103a6839ff10e5c8e7ac25b4948202e829/code/Example/Drasil/SWHS/DataDefs.hs#L47-L50

  5. Missing initial case Q(0) = 0 for ODE latHtEEqn https://github.com/JacquesCarette/Drasil/blob/060c5ca8ef5433fea876b9c1f20cb98bd7bdc343/code/Example/Drasil/SWHS/TMods.hs#L140-L142

@szymczdm The problems right now is that these 1) either need to be added to the equation section of the table, which doesn't have a place for any comments (i.e they are formed using only the Expr type). 2) Or the description section which is automatically generated based upon the variables in the equation section.

szymczdm commented 6 years ago

Alright, so 1, 2, and 3 all seem to be looking at supplementary (necessary!) information. These are non-trivial things we need to include.

Number 4 should be pretty straightforward, we just need to add a constraint to the phi chunk (wherever that's defined). We should already have the means to do this.

For number 5, that might be a new type of information (initial values) that we'll need to capture. But I'll need to take a second look to see if we have a mechanism for that buried somewhere already or not.

balacij commented 4 months ago

Looking at this again, I believe @smiths' original suggestion is possible. While descriptions are partially generated, they are generated from something. My first reaction is that $q_C$ should have "over area $A_C$" in its description. Alternatively, we can add a note in the description box that this definition only applies for a specific area. If we really want this to occur somewhere in the equation box, I don't think it should appear as text, but rather as a mathematical constraint placed on it. That being said, I'm unfamiliar with this project, so take what I say with a grain of salt.

smiths commented 4 months ago

@balacij there are two important pieces of information, the equation for $q_c$ and the boundary over which this equation applies. To reuse $q_c$ we want to easily be able to change where it applies. We want the text to appear, but what would be really great is if we could capture the "meaning" first and generate the text second.

When we have a partial differential equation in space (like the conservation of energy equation) to get a unique solution to the equation we need to specify the boundary conditions at the "edges" of the space. If we specify the temperature at the boundary we have a Dirichlet boundary condition. If we specify the flux (gradient) we have a Neumann boundary condition. The current case being discussed is a Neumann boundary condition.

We've never taught Drasil anything about partial differential equations (PDEs), but hopefully there will come a day when we can teach it the theory of PDEs.