Skip to content

Commit

Permalink
JC/D JacquesCarette#2892 : Replace posInf/negInf with existing DQDs a…
Browse files Browse the repository at this point in the history
…nd remove them from symbol table of pdcontroller.
  • Loading branch information
balacij committed Jan 24, 2023
1 parent c7c57e7 commit 551def8
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ chooseConcept chs = sequence $ Map.mapWithKey chooseConcept' (conceptMatch $ map

-- | Translates a 'CodeConcept' into GOOL.
conceptToGOOL :: (OOProg r) => CodeConcept -> SValue r
conceptToGOOL Pi = pi
conceptToGOOL Pi = pi
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import Data.Drasil.Concepts.PhysicalProperties (physicalcon)
import Data.Drasil.Concepts.Physics (angular, linear) -- FIXME: should not be needed?
import Data.Drasil.Quantities.PhysicalProperties (mass)
import Data.Drasil.SI_Units (second, kilogram)
import Data.Drasil.Quantities.Math (posInf, negInf)

import Drasil.PDController.Assumptions (assumptions)
import Drasil.PDController.Changes (likelyChgs)
Expand Down Expand Up @@ -123,7 +124,7 @@ symbolsAll = symbols ++ map qw pidDqdConstants ++ map qw pidConstants
++ map qw [listToArray $ quantvar opProcessVariable, arrayVecDepVar pidODEInfo]

symbMap :: ChunkDB
symbMap = cdb (map qw physicscon ++ symbolsAll ++ [qw mass])
symbMap = cdb (map qw physicscon ++ symbolsAll ++ [qw mass, qw posInf, qw negInf])
(nw pidControllerSystem : [nw program, nw angular, nw linear]
++ map nw doccon ++ map nw doccon' ++ concepts ++ map nw mathcon
++ map nw mathcon' ++ map nw [second, kilogram] ++ map nw symbols
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ import Language.Drasil.Chunk.Concept.NamedCombinators
import qualified Language.Drasil.Sentence.Combinators as S
import Data.Drasil.Citations(laplaceWiki)
import Drasil.PDController.Unitals
import Data.Drasil.Quantities.Math (posInf, negInf)

theoreticalModels :: [TheoryModel]
theoreticalModels = [tmLaplace, tmInvLaplace, tmSOSystem]

tmLaplace :: TheoryModel
tmLaplace
= tm (othModel' laplaceRC)
[qw qdLaplaceTransform, qw qdFreqDomain, qw time, qw qdPosInf,
[qw qdLaplaceTransform, qw qdFreqDomain, qw time, qw posInf,
qw qdFxnTDomain]
([] :: [ConceptChunk])
[]
Expand All @@ -36,7 +37,7 @@ laplaceRC = makeRC "laplaceRC" (cn' "Laplace Transform") EmptyS laplaceRel
laplaceRel :: Relation
laplaceRel
= sy qdLaplaceTransform $=
defint (eqSymb time) (sy qdNegInf) (sy qdPosInf) (sy qdFxnTDomain
defint (eqSymb time) (sy negInf) (sy posInf) (sy qdFxnTDomain
`mulRe` DrasilLang.exp (neg (sy qdFreqDomain) `mulRe` sy time))

laplaceDesc :: Sentence
Expand All @@ -52,7 +53,7 @@ laplaceDesc
tmInvLaplace :: TheoryModel
tmInvLaplace
= tm (othModel' invlaplaceRC)
[qw qdLaplaceTransform, qw qdFreqDomain, qw time, qw qdPosInf,
[qw qdLaplaceTransform, qw qdFreqDomain, qw time, qw posInf,
qw qdFxnTDomain]
([] :: [ConceptChunk])
[]
Expand Down Expand Up @@ -111,5 +112,3 @@ soSystemDesc
`S.ofA` phrase secondOrderSystem,
sParen (S "mass-spring-damper"),
S "is characterized by this equation"]

--------
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import Language.Drasil.Chunk.Concept.NamedCombinators

import Drasil.PDController.Concepts

syms, symFS, symFt, symnegInf, symposInf, syminvLaplace, symKd, symKp,
syms, symFS, symFt, syminvLaplace, symKd, symKp,
symYT, symYS, symYrT, symYrS, symET, symES, symPS, symDS, symHS,
symCT, symCS, symTStep, symTSim, symAbsTol, symRelTol,
symDampingCoeff, symStifnessCoeff :: Symbol

symnegInf = variable "-∞"
symposInf = variable ""
symFS = sub (variable "F") $ label "s"
syminvLaplace = variable "L⁻¹[F(s)]"
syms = variable "s"
Expand All @@ -40,14 +38,14 @@ symStifnessCoeff = variable "k"

symbols :: [QuantityDict]
symbols
= [qdLaplaceTransform, qdFreqDomain, qdFxnTDomain, qdNegInf, qdPosInf,
= [qdLaplaceTransform, qdFreqDomain, qdFxnTDomain,
qdInvLaplaceTransform, qdPropGain, qdDerivGain, qdSetPointTD, qdSetPointFD,
qdProcessVariableTD, qdProcessVariableFD, qdProcessErrorTD,
qdProcessErrorFD, qdDerivativeControlFD, qdPropControlFD,
qdTransferFunctionFD, qdCtrlVarTD, qdCtrlVarFD, qdStepTime, qdSimTime,
qdDampingCoeff, qdStiffnessCoeff]

qdLaplaceTransform, qdFreqDomain, qdFxnTDomain, qdNegInf, qdPosInf,
qdLaplaceTransform, qdFreqDomain, qdFxnTDomain,
qdInvLaplaceTransform, qdPropGain, qdDerivGain,
qdSetPointTD, qdSetPointFD, qdProcessVariableTD,
qdProcessVariableFD, qdProcessErrorTD, qdProcessErrorFD,
Expand Down Expand Up @@ -167,11 +165,6 @@ qdFxnTDomain
= vc "qdFxnTDomain" (nounPhraseSent (S "Function in the time domain")) symFt
Real

qdNegInf
= vc "qdNegInf" (nounPhraseSent (S "Negative Infinity")) symnegInf Real

qdPosInf = vc "qdPosInf" (nounPhraseSent (S "Infinity")) symposInf Real

qdInvLaplaceTransform
= vc "qInvLaplaceTransform"
(nounPhraseSent (S "Inverse Laplace Transform of a function"))
Expand Down
8 changes: 4 additions & 4 deletions code/drasil-lang/lib/Language/Drasil/ShortHands.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Language.Drasil.Symbol.Helpers (variable)
-- | Short forms of various variable names. c means /capital/; l means /lowercase/.
cA,cB,cC,cD,cE,cF,cG,cH,cI,cJ,cK,cL,cM,cN,cO,cP,cQ,cR,cS,cT,cU,cV,cW,cX,cY,cZ,
lA,lB,lC,lD,lE,lF,lG,lH,lI,lJ,lK,lL,lM,lN,lO,lP,lQ,lR,lS,lT,lU,lV,
lW,lX,lY,lZ,lAlpha,cAlpha,lBeta,cBeta,lGamma,cGamma,lDelta,cDelta,lEpsilon,vEpsilon,
lW,lX,lY,lZ,lAlpha,cAlpha,lBeta,cBeta,lGamma,cGamma,lDelta,cDelta,lEpsilon,vEpsilon,
cEpsilon,lZeta,cZeta,lEta,cEta,lTheta,cTheta,lIota,cIota,lKappa,cKappa,lLambda,cLambda,
lMu,cMu,lNu,cNu,lXi,cXi,lOmicron,cOmicron,lPi,cPi,lRho,cRho,lSigma,cSigma,lTau,cTau,
lUpsilon,cUpsilon,lPhi,vPhi,cPhi,lChi,cChi,lPsi,cPsi,lOmega,cOmega,lNabla,lEll,lPosInf,lNegInf :: Symbol
Expand Down Expand Up @@ -104,9 +104,9 @@ cPi = variable "Π"
lRho = variable "ρ"
cRho = variable "Ρ"
lSigma = variable "σ"
cSigma = variable "Σ"
cSigma = variable "Σ"
lTau = variable "τ"
cTau = variable "Τ"
cTau = variable "Τ"
lUpsilon = variable "υ"
cUpsilon = variable "Υ"
lPhi = variable "ϕ"
Expand All @@ -121,4 +121,4 @@ cOmega = variable "Ω"
lNabla = variable ""
lEll = variable ""
lNegInf = variable "-∞"
lPosInf = variable ""
lPosInf = variable ""
10 changes: 0 additions & 10 deletions code/stable/pdcontroller/SRS/HTML/PDController_SRS.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions code/stable/pdcontroller/SRS/JSON/PDController_SRS.ipynb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions code/stable/pdcontroller/SRS/PDF/PDController_SRS.tex

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 551def8

Please sign in to comment.