Skip to content

Commit

Permalink
added new fields into example SI
Browse files Browse the repository at this point in the history
  • Loading branch information
Xinlu-Y committed Sep 3, 2024
1 parent 915505d commit 267b547
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 22 deletions.
15 changes: 12 additions & 3 deletions code/drasil-example/dblpend/lib/Drasil/DblPend/Body.hs
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ si = SI {
_kind = Doc.srs,
_authors = [dong],
_purpose = [purp],
_background = [],
_motivation = [],
_scope = [],
_background = [background],
_motivation = [motivation],
_scope = [scope],
_quants = symbolsAll,
_concepts = [] :: [DefinedQuantityDict],
_instModels = iMods,
Expand All @@ -131,6 +131,15 @@ si = SI {
purp :: Sentence
purp = foldlSent_ [S "predict the", phrase motion `S.ofA` S "double", phrase pendulum]

motivation :: Sentence
motivation = foldlSent_ [S "To simulate", phraseNP (motion `the_ofThe` pendulum),
S "and exhibit its chaotic characteristics"]

background :: Sentence
background = foldlSent_ [phraseNP (a_ pendulum), S "consists" `S.of_` phrase mass,
S "attached to the end" `S.ofA` phrase rod `S.andIts` S "moving curve" `S.is`
(S "highly sensitive to initial conditions")]

symbolsAll :: [QuantityDict]
symbolsAll = symbols ++ scipyODESymbols ++ osloSymbols ++ apacheODESymbols ++ odeintSymbols
++ map qw [listToArray $ quantvar pendDisAngle, arrayVecDepVar dblPenODEInfo]
Expand Down
9 changes: 7 additions & 2 deletions code/drasil-example/glassbr/lib/Drasil/GlassBR/Body.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ si = SI {
_kind = Doc.srs,
_authors = [nikitha, spencerSmith],
_purpose = [purp],
_background = [],
_background = [background],
_motivation = [],
_scope = [],
_scope = [scope],
_quants = symbolsForTable,
_concepts = [] :: [DefinedQuantityDict],
_instModels = iMods,
Expand Down Expand Up @@ -129,6 +129,11 @@ purp :: Sentence
purp = foldlSent_ [S "predict whether a", phrase glaSlab, S "can withstand a",
phrase blast, S "under given", plural condition]

background :: Sentence
background = foldlSent_ [phrase explosion, S "in downtown areas are dangerous from the",
phrase blast +:+ S "itself" `S.and_` S "also potentially from the secondary"
+:+ S "effect of falling glass"]

symbMap :: ChunkDB
symbMap = cdb thisSymbols (map nw acronyms ++ map nw thisSymbols ++ map nw con
++ map nw con' ++ map nw terms ++ map nw doccon ++ map nw doccon' ++ map nw educon
Expand Down
17 changes: 13 additions & 4 deletions code/drasil-example/pdcontroller/lib/Drasil/PDController/Body.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import Drasil.PDController.GenSysDesc
gsduserCharacteristics)
import Drasil.PDController.IModel (instanceModels, imPD)
import Drasil.PDController.IntroSection (introPara, introPurposeOfDoc, externalLinkRef,
introUserChar1, introUserChar2, introscopeOfReq)
introUserChar1, introUserChar2, introscopeOfReq, scope)
import Drasil.PDController.References (citations)
import Drasil.PDController.Requirements (funcReqs, nonfuncReqs)
import Drasil.PDController.SpSysDesc (goals, sysFigure, sysGoalInput, sysParts)
Expand Down Expand Up @@ -102,9 +102,9 @@ si = SI {
_kind = Doc.srs,
_authors = [naveen],
_purpose = [purp],
_background = [],
_motivation = [],
_scope = [],
_background = [background],
_motivation = [motivation],
_scope = [scope],
_quants = symbolsAll,
_concepts = [] :: [DefinedQuantityDict],
_datadefs = dataDefinitions,
Expand All @@ -124,6 +124,15 @@ purp = foldlSent_ [S "provide a model of a", phrase pidC,
S "that can be used for the tuning of the gain constants before",
S "the deployment of the controller"]

motivation :: Sentence
motivation = foldlSent_ [S "The gains of a controller in an application" +:+
S "must be tuned before the controller is ready for production"]

background :: Sentence
background = foldlSent_ [S "Automatic process control with a controller (P/PI/PD/PID) is used",
S "in a variety of applications such as thermostats, automobile",
S "cruise-control, etc"]

symbolsAll :: [QuantityDict]
symbolsAll = symbols ++ map qw pidDqdConstants ++ map qw pidConstants
++ scipyODESymbols ++ osloSymbols ++ apacheODESymbols ++ odeintSymbols
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ introscopeOfReq
S "Additionally, this software is intended to aid with the manual",
S "tuning of the", phrase pidC]

scope :: Sentence
scope = foldlSent_ [phraseNP (a_ pidCL),
S "with three subsystems, namely:" +:+
foldlList Comma List (map (phraseNP.a_)
[pidC, summingPt, powerPlant])]

introPurposeOfDoc
= foldlSent
[S "The purpose of this document is to capture all the necessary",
Expand Down
15 changes: 10 additions & 5 deletions code/drasil-example/projectile/lib/Drasil/Projectile/Body.hs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,6 @@ mkSRS = [TableOfContents,
Bibliography
]

motivation :: Sentence
motivation = foldlSent_ [phrase projectile, phrase motion, S "is a common" +:+
phraseNP (problem `in_` physics)]

justification, scope :: Sentence
justification = foldlSent [atStart projectile, phrase motion, S "is a common" +:+.
phraseNP (problem `in_` physics), S "Therefore, it is useful to have a",
Expand Down Expand Up @@ -140,7 +136,7 @@ si = SI {
_kind = Doc.srs,
_authors = [samCrawford, brooks, spencerSmith],
_purpose = [purp],
_background = [],
_background = [background],
_motivation = [motivation],
_scope = [scope],
_quants = symbols,
Expand All @@ -161,6 +157,15 @@ si = SI {
purp :: Sentence
purp = foldlSent_ [S "predict whether a launched", phrase projectile, S "hits its", phrase target]

motivation :: Sentence
motivation = foldlSent_ [phrase projectile, phrase motion, S "is a common" +:+
phraseNP (problem `in_` physics)]

background :: Sentence
background = foldlSent_ [S "Common examples of", phrase projectile, phrase motion, S "include",
S "ballistics", plural problem, S "(missiles and bullets)" `S.andThe` S "flight of the balls",
S "in various sports (baseball, golf, football, etc.)"]

tMods :: [TheoryModel]
tMods = [accelerationTM, velocityTM]

Expand Down
8 changes: 6 additions & 2 deletions code/drasil-example/swhs/lib/Drasil/SWHS/Body.hs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ si = SI {
_authors = [thulasi, brooks, spencerSmith],
_purpose = [purp],
_background = [],
_motivation = [],
_scope = [],
_motivation = [motivation],
_scope = [scope],
_quants = symbols,
_concepts = [] :: [DefinedQuantityDict],
_instModels = insModel,
Expand All @@ -102,6 +102,10 @@ purp :: Sentence
purp = foldlSent_ [S "investigate the effect" `S.of_` S "employing",
short phsChgMtrl, S "within a", phrase sWHT]

motivation :: Sentence
motivation = foldlSent_ [S "the demand is high for renewable", pluralNP (enerSrc `and_PS`
energy), S "storage technology"]

symbMap :: ChunkDB
symbMap = cdb (qw (heatEInPCM ^. output) : symbolsAll) -- heatEInPCM ?
(nw heatEInPCM : map nw symbols ++ map nw acronymsFull
Expand Down
12 changes: 6 additions & 6 deletions code/drasil-example/swhsnopcm/lib/Drasil/SWHSNoPCM/Body.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ import Data.Drasil.SI_Units (metre, kilogram, second, centigrade, joule, watt,
-- Since NoPCM is a simplified version of SWHS, the file is to be built off
-- of the SWHS libraries. If the source for something cannot be found in
-- NoPCM, check SWHS.
import Drasil.SWHS.Body (charsOfReader, dataContMid, introStart, externalLinkRef,
physSyst1, physSyst2, sysCntxtDesc, systContRespBullets,
sysCntxtRespIntro, userChars)
import Drasil.SWHS.Body (charsOfReader, dataContMid, motivation,
introStart, externalLinkRef, physSyst1, physSyst2, sysCntxtDesc,
systContRespBullets, sysCntxtRespIntro, userChars)
import Drasil.SWHS.Changes (likeChgTCVOD, likeChgTCVOL, likeChgTLH)
import Drasil.SWHS.Concepts (acronyms, coil, sWHT, tank, transient, water, con, phsChgMtrl)
import Drasil.SWHS.Requirements (nfRequirements)
Expand Down Expand Up @@ -176,9 +176,9 @@ si = SI {
_kind = Doc.srs,
_authors = [thulasi],
_purpose = [purp],
_background = [],
_motivation = [],
_scope = [],
_background = [introStartNoPCM],
_motivation = [motivation],
_scope = [scope],
-- FIXME: Everything after (and including) \\ should be removed when
-- #1658 is resolved. Basically, _quants is used here, but
-- tau does not appear in the document and thus should not be displayed.
Expand Down

0 comments on commit 267b547

Please sign in to comment.