-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SSP Surface Hydrostatic Force Derivation (#1286)
* Added some generic concepts and quantities needed for the derivation * Added weight DD needed for derivation * Added the derivation * Updated stable * Moved references to unit weights to correct DDs * Made first derivation equation indexed * Moved Newton's 2nd law to drasil data so I can re-use it in SSP * Imported the Newtons 2nd law TM in SSP * Changed surface hydro force from DD to GD * Changed weight DD to a GD in drasil-data * Updated stable * Added derivation of weight GD and added Theories file in drasil-data which I forgot to add many commits ago * Added new assumption and used it in derivation for surfHydroForce * Removed left and right surf hydro force DDs, combined everything in the new GD * Fixed warning * Added missing source to new weight GD * Updated stable * Updated conditions for surface hydro force equation cases * Updated derivation of weight to explain how newton's 2nd law specializes * Updated stable
- Loading branch information
1 parent
27acedc
commit ce28891
Showing
20 changed files
with
1,345 additions
and
1,156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 10 additions & 8 deletions
18
code/drasil-data/Data/Drasil/Quantities/PhysicalProperties.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
module Data.Drasil.Quantities.PhysicalProperties where | ||
|
||
import Language.Drasil | ||
import Language.Drasil.ShortHands (lM, cL, cV, lRho) | ||
import Language.Drasil.ShortHands (lM, cL, cV, lGamma, lRho) | ||
|
||
import Data.Drasil.Concepts.PhysicalProperties as CPP (density, len, mass, vol) | ||
import Data.Drasil.SI_Units (kilogram, metre, m_3) | ||
import Data.Drasil.Concepts.PhysicalProperties as CPP (density, specWeight, len, | ||
mass, vol) | ||
import Data.Drasil.SI_Units (kilogram, metre, m_3, specificWeight) | ||
import Data.Drasil.Units.PhysicalProperties (densityU) | ||
|
||
density, mass, len, vol :: UnitalChunk | ||
density = uc CPP.density lRho densityU | ||
mass = uc CPP.mass lM kilogram | ||
len = uc CPP.len cL metre | ||
vol = uc CPP.vol cV m_3 | ||
density, specWeight, mass, len, vol :: UnitalChunk | ||
density = uc CPP.density lRho densityU | ||
specWeight = uc CPP.specWeight lGamma specificWeight | ||
mass = uc CPP.mass lM kilogram | ||
len = uc CPP.len cL metre | ||
vol = uc CPP.vol cV m_3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
module Data.Drasil.Theories.Physics where | ||
|
||
import Language.Drasil | ||
import Theory.Drasil (GenDefn, gd) | ||
import Data.Drasil.Utils (weave) | ||
import Data.Drasil.SentenceStructures (foldlSent, foldlSentCol, ofThe, sAnd, | ||
sOf) | ||
import Data.Drasil.Concepts.Documentation (body, component, constant, value) | ||
import Data.Drasil.Concepts.Math (vector) | ||
import Data.Drasil.Concepts.Physics (cartesian, twoD) | ||
import qualified Data.Drasil.Quantities.Math as QM (unitVectj) | ||
import qualified Data.Drasil.Quantities.PhysicalProperties as QPP (density, | ||
mass, specWeight, vol) | ||
import qualified Data.Drasil.Quantities.Physics as QP (acceleration, force, | ||
gravitationalAccel, weight) | ||
|
||
physicsTMs :: [TheoryModel] | ||
physicsTMs = [newtonSL] | ||
|
||
newtonSL :: TheoryModel | ||
newtonSL = tmNoRefs (cw newtonSLRC) | ||
[qw QP.force, qw QPP.mass, qw QP.acceleration] ([] :: [ConceptChunk]) | ||
[] [(sy QP.force) $= (sy QPP.mass) * (sy QP.acceleration)] [] | ||
"NewtonSecLawMot" [newtonSLDesc] | ||
|
||
newtonSLRC :: RelationConcept | ||
newtonSLRC = makeRC "newtonSL" (nounPhraseSP "Newton's second law of motion") | ||
newtonSLDesc newtonSLRel | ||
|
||
newtonSLRel :: Relation | ||
newtonSLRel = (sy QP.force) $= (sy QPP.mass) * (sy QP.acceleration) | ||
|
||
newtonSLDesc :: Sentence | ||
newtonSLDesc = foldlSent [S "The net", (phrase QP.force), (ch QP.force), | ||
(sParen $ Sy $ unit_symb QP.force), S "on a", phrase body, | ||
S "is proportional to the", (phrase QP.acceleration), | ||
(ch QP.acceleration), (sParen $ Sy $ unit_symb QP.acceleration), | ||
S "of the", phrase body `sC` S "where", (ch QPP.mass), | ||
(sParen $ Sy $ unit_symb QPP.mass), S "denotes", (phrase QPP.mass) `ofThe` | ||
phrase body, S "as the", phrase constant `sOf` S "proportionality"] | ||
|
||
-- | ||
|
||
weightGD :: GenDefn | ||
weightGD = gd weightRC (getUnit QP.weight) weightDeriv [weightSrc] | ||
"weight" [{-Notes-}] | ||
|
||
weightRC :: RelationConcept | ||
weightRC = makeRC "weight" (nounPhraseSP "weight") EmptyS weightEqn | ||
|
||
weightEqn :: Relation | ||
weightEqn = sy QP.weight $= sy QPP.vol * sy QPP.specWeight | ||
|
||
weightSrc :: Reference | ||
weightSrc = makeURI "weightSrc" "https://en.wikipedia.org/wiki/Weight" $ | ||
shortname' "Definition of Weight" | ||
|
||
weightDeriv :: Derivation | ||
weightDeriv = weave [weightDerivSentences, weightDerivEqns] | ||
|
||
weightDerivSentences, weightDerivEqns :: [Sentence] | ||
weightDerivSentences = map foldlSentCol [weightDerivAccelSentence, | ||
weightDerivNewtonSentence, weightDerivReplaceMassSentence, | ||
weightDerivSpecWeightSentence] | ||
weightDerivEqns = map E [weightDerivAccelEqn, weightDerivNewtonEqn, | ||
weightDerivReplaceMassEqn, weightDerivSpecWeightEqn] | ||
|
||
weightDerivAccelSentence :: [Sentence] | ||
weightDerivAccelSentence = [S "Under the influence of gravity" `sC` | ||
S "and assuming a", short twoD, phrase cartesian, | ||
S "with down as positive" `sC` S "an object has an", phrase QP.acceleration, | ||
phrase vector, S "of"] | ||
|
||
weightDerivNewtonSentence :: [Sentence] | ||
weightDerivNewtonSentence = [S "Since there is only one non-zero", | ||
phrase vector, phrase component `sC` S "the scalar", phrase value, | ||
ch QP.weight, S "will be used for the" +:+. phrase QP.weight, | ||
S "In this scenario" `sC` phrase newtonSL, S "from", makeRef2S newtonSL, | ||
S "can be expressed as"] | ||
|
||
weightDerivReplaceMassSentence :: [Sentence] | ||
weightDerivReplaceMassSentence = [at_start QPP.mass, S "can be expressed as", | ||
phrase QPP.density, S "multiplied by", phrase QPP.vol `sC` S "resulting in"] | ||
|
||
weightDerivSpecWeightSentence :: [Sentence] | ||
weightDerivSpecWeightSentence = [S "Substituting", phrase QPP.specWeight, | ||
S "as the product of", phrase QPP.density `sAnd` phrase QP.gravitationalAccel, | ||
S "yields"] | ||
|
||
weightDerivAccelEqn :: Expr | ||
weightDerivAccelEqn = sy QP.acceleration $= vec2D 0 (sy QP.gravitationalAccel * | ||
sy QM.unitVectj) | ||
|
||
weightDerivNewtonEqn :: Expr | ||
weightDerivNewtonEqn = sy QP.weight $= sy QPP.mass * sy QP.gravitationalAccel | ||
|
||
weightDerivReplaceMassEqn :: Expr | ||
weightDerivReplaceMassEqn = sy QP.weight $= sy QPP.density * sy QPP.vol * sy QP.gravitationalAccel | ||
|
||
weightDerivSpecWeightEqn :: Expr | ||
weightDerivSpecWeightEqn = sy QP.weight $= sy QPP.vol * sy QPP.specWeight | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.