diff --git a/docs/literate/composite_models_examples.jl b/docs/literate/composite_models_examples.jl index 71fe904..349f67d 100644 --- a/docs/literate/composite_models_examples.jl +++ b/docs/literate/composite_models_examples.jl @@ -58,6 +58,7 @@ h = AMR.Header("harmonic_oscillator", "v1.0") # The easiest way to write down a DecaExpr is in our DSL and calling the parser. +# This formula is $$∂ₜ(∂ₜ(x)) = -kx$$. dexpr = DiagrammaticEquations.parse_decapode(quote X::Form0{Point} V::Form0{Point} @@ -72,7 +73,10 @@ end # That gave us the first model d1 = ASKEMDecaExpr(h, dexpr) -# The second model is: +# The second model is given by: +# $$ ∂ₜQ = κ*V + λ(Q - Q₀) $$ +# +# d2 = ASKEMDecaExpr( AMR.Header("fricative_heating", "modelreps.io/SummationDecapode", @@ -125,7 +129,10 @@ uwdʰ = UWDExpr([v, Q], [Statement(:drag, [v, Q₊]), Statement(:cooling, [Q₋, # Our three primitive subsystems are each composed of one equation. Of course at this scale of complexity, you don't # need to do compositional specification, you can just compose them in your head and write down the composite. # But this is a tutorial, so we are building a very simple model as a composite of atomic models (one equation each). - +# +# The formula for drag is +# $$ Q₊ == κ*V $$ +# drag = ASKEMDecaExpr( AMR.Header("DragHeat", "modelreps.io/SummationDecapode", "velocity makes it get hot", "SummationDecapode", "v1.0"), DiagrammaticEquations.parse_decapode(quote @@ -137,6 +144,9 @@ drag = ASKEMDecaExpr( end) ) +# Our cooling formula is +# $$ Q₋ == λ(Q-Q₀) $$ + cooling = ASKEMDecaExpr( AMR.Header("NetwonCooling", "modelreps.io/SummationDecapode", "heat dissipates to the enviornment", "SummationDecapode", "v1.0"), DiagrammaticEquations.parse_decapode(quote @@ -149,6 +159,8 @@ cooling = ASKEMDecaExpr( end) ) +# Linear Superposition is just $$T == X + Y$$ + superposition = ASKEMDecaExpr( AMR.Header("LinearSuperpositon", "modelreps.io/SummationDecapode", "variables be addin", "SummationDecapode", "v1.0"), DiagrammaticEquations.parse_decapode(quote diff --git a/docs/literate/decapodes_examples.jl b/docs/literate/decapodes_examples.jl index 6f81818..6e44411 100644 --- a/docs/literate/decapodes_examples.jl +++ b/docs/literate/decapodes_examples.jl @@ -18,7 +18,7 @@ using ACSets.JSONACSets using DiagrammaticEquations using Test -# Build the heder object describing the model. +# Build the header object describing the model. h = AMR.Header("harmonic_oscillator", "modelreps.io/DecaExpr", @@ -27,6 +27,8 @@ h = AMR.Header("harmonic_oscillator", "v1.0") # The easiest way to write down a DecaExpr is in our DSL and calling the parser. +# This example is $$x'' = -kx$$. We have manual transformed this into first order ODE +# by introducing a velocity variable for $$x'$$. dexpr = DiagrammaticEquations.parse_decapode(quote X::Form0{Point} V::Form0{Point}