module Drasil.Projectile.Derivations (
timeDeriv,
landPosDeriv,
rectVelDeriv,
rectPosDeriv
) where
import Prelude hiding (cos, sin)
import Language.Drasil (eqSymb, LiteralC(..), ModelExprC(..), ExprC(..),
ModelExpr, square, half)
import qualified Data.Drasil.Quantities.Physics as QP (iSpeed, constAccel)
import Data.Drasil.Quantities.Physics (gravitationalAccelConst, iPos, ixVel, iyVel, scalarPos, speed, time, xPos, yPos)
import Drasil.Projectile.Unitals (launAngle, launSpeed, landPos, flightDur)
timeDeriv :: [ModelExpr]
timeDeriv :: [ModelExpr]
timeDeriv = [ModelExpr
timeDerivEqn1, ModelExpr
timeDerivEqn2, ModelExpr
timeDerivEqn3, ModelExpr
timeDerivEqn4]
timeDerivEqn1, timeDerivEqn2, timeDerivEqn3, timeDerivEqn4 :: ModelExpr
timeDerivEqn1 :: ModelExpr
timeDerivEqn1 = forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
yPos forall r. ExprC r => r -> r -> r
$= (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
iyVel forall r. ExprC r => r -> r -> r
`mulRe` forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
time) forall r. ExprC r => r -> r -> r
$- forall r. (ExprC r, LiteralC r) => r -> r
half (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy ConstQDef
gravitationalAccelConst forall r. ExprC r => r -> r -> r
`mulRe` forall r. (ExprC r, LiteralC r) => r -> r
square (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
time))
timeDerivEqn2 :: ModelExpr
timeDerivEqn2 = (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
iyVel forall r. ExprC r => r -> r -> r
`mulRe` forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy ConstrConcept
flightDur) forall r. ExprC r => r -> r -> r
$- forall r. (ExprC r, LiteralC r) => r -> r
half (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy ConstQDef
gravitationalAccelConst forall r. ExprC r => r -> r -> r
`mulRe` forall r. (ExprC r, LiteralC r) => r -> r
square (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy ConstrConcept
flightDur)) forall r. ExprC r => r -> r -> r
$= forall r. LiteralC r => Integer -> r
exactDbl Integer
0
timeDerivEqn3 :: ModelExpr
timeDerivEqn3 = forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
iyVel forall r. ExprC r => r -> r -> r
$- forall r. (ExprC r, LiteralC r) => r -> r
half (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy ConstQDef
gravitationalAccelConst forall r. ExprC r => r -> r -> r
`mulRe` forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy ConstrConcept
flightDur) forall r. ExprC r => r -> r -> r
$= forall r. LiteralC r => Integer -> r
exactDbl Integer
0
timeDerivEqn4 :: ModelExpr
timeDerivEqn4 = forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy ConstrConcept
flightDur forall r. ExprC r => r -> r -> r
$= forall r. LiteralC r => Integer -> r
exactDbl Integer
2 forall r. ExprC r => r -> r -> r
`mulRe` forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
iyVel forall r. ExprC r => r -> r -> r
$/ forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy ConstQDef
gravitationalAccelConst
landPosDeriv :: [ModelExpr]
landPosDeriv :: [ModelExpr]
landPosDeriv = [ModelExpr
landPosDerivEqn1, ModelExpr
landPosDerivEqn2, ModelExpr
landPosDerivEqn3]
landPosDerivEqn1, landPosDerivEqn2, landPosDerivEqn3 :: ModelExpr
landPosDerivEqn1 :: ModelExpr
landPosDerivEqn1 = forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
xPos forall r. ExprC r => r -> r -> r
$= forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
ixVel forall r. ExprC r => r -> r -> r
`mulRe` forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
time
landPosDerivEqn2 :: ModelExpr
landPosDerivEqn2 = forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy ConstrConcept
landPos forall r. ExprC r => r -> r -> r
$= forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
ixVel forall r. ExprC r => r -> r -> r
`mulRe` forall r. LiteralC r => Integer -> r
exactDbl Integer
2 forall r. ExprC r => r -> r -> r
`mulRe` forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy ConstrConcept
launSpeed forall r. ExprC r => r -> r -> r
`mulRe` forall r. ExprC r => r -> r
sin (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy ConstrConcept
launAngle) forall r. ExprC r => r -> r -> r
$/ forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy ConstQDef
gravitationalAccelConst
landPosDerivEqn3 :: ModelExpr
landPosDerivEqn3 = forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy ConstrConcept
landPos forall r. ExprC r => r -> r -> r
$= forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy ConstrConcept
launSpeed forall r. ExprC r => r -> r -> r
`mulRe` forall r. ExprC r => r -> r
cos (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy ConstrConcept
launAngle) forall r. ExprC r => r -> r -> r
`mulRe` forall r. LiteralC r => Integer -> r
exactDbl Integer
2 forall r. ExprC r => r -> r -> r
`mulRe` forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy ConstrConcept
launSpeed forall r. ExprC r => r -> r -> r
`mulRe` forall r. ExprC r => r -> r
sin (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy ConstrConcept
launAngle) forall r. ExprC r => r -> r -> r
$/ forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy ConstQDef
gravitationalAccelConst
rectVelDeriv :: [ModelExpr]
rectVelDeriv :: [ModelExpr]
rectVelDeriv = [ModelExpr
rectVelDerivEqn1, ModelExpr
rectVelDerivEqn2]
rectVelDerivEqn1, rectVelDerivEqn2 :: ModelExpr
rectVelDerivEqn1 :: ModelExpr
rectVelDerivEqn1 = forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
QP.constAccel forall r. ExprC r => r -> r -> r
$= forall r c. (ModelExprC r, HasUID c, HasSymbol c) => r -> c -> r
deriv (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
speed) UnitalChunk
time
rectVelDerivEqn2 :: ModelExpr
rectVelDerivEqn2 = forall r. ExprC r => Symbol -> r -> r -> r -> r
defint (forall q. HasSymbol q => q -> Symbol
eqSymb UnitalChunk
speed) (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
QP.iSpeed) (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
speed) (forall r. LiteralC r => Integer -> r
exactDbl Integer
1) forall r. ExprC r => r -> r -> r
$=
forall r. ExprC r => Symbol -> r -> r -> r -> r
defint (forall q. HasSymbol q => q -> Symbol
eqSymb UnitalChunk
time) (forall r. LiteralC r => Integer -> r
exactDbl Integer
0) (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
time) (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
QP.constAccel)
rectPosDeriv :: [ModelExpr]
rectPosDeriv :: [ModelExpr]
rectPosDeriv = [ModelExpr
rectPosDerivEqn1, ModelExpr
rectPosDerivEqn2, ModelExpr
rectPosDerivEqn3]
rectPosDerivEqn1, rectPosDerivEqn2, rectPosDerivEqn3 :: ModelExpr
rectPosDerivEqn1 :: ModelExpr
rectPosDerivEqn1 = forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
speed forall r. ExprC r => r -> r -> r
$= forall r c. (ModelExprC r, HasUID c, HasSymbol c) => r -> c -> r
deriv (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
scalarPos) UnitalChunk
time
rectPosDerivEqn2 :: ModelExpr
rectPosDerivEqn2 = forall r. ExprC r => Symbol -> r -> r -> r -> r
defint (forall q. HasSymbol q => q -> Symbol
eqSymb UnitalChunk
scalarPos) (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
iPos) (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
scalarPos) (forall r. LiteralC r => Integer -> r
exactDbl Integer
1) forall r. ExprC r => r -> r -> r
$=
forall r. ExprC r => Symbol -> r -> r -> r -> r
defint (forall q. HasSymbol q => q -> Symbol
eqSymb UnitalChunk
time) (forall r. LiteralC r => Integer -> r
exactDbl Integer
0) (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
time) (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
speed)
rectPosDerivEqn3 :: ModelExpr
rectPosDerivEqn3 = forall r. ExprC r => Symbol -> r -> r -> r -> r
defint (forall q. HasSymbol q => q -> Symbol
eqSymb UnitalChunk
scalarPos) (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
iPos) (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
scalarPos) (forall r. LiteralC r => Integer -> r
exactDbl Integer
1) forall r. ExprC r => r -> r -> r
$=
forall r. ExprC r => Symbol -> r -> r -> r -> r
defint (forall q. HasSymbol q => q -> Symbol
eqSymb UnitalChunk
time) (forall r. LiteralC r => Integer -> r
exactDbl Integer
0) (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
time) (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
QP.iSpeed forall r. ExprC r => r -> r -> r
`addRe` (forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
QP.constAccel forall r. ExprC r => r -> r -> r
`mulRe` forall r c. (ExprC r, HasUID c, HasSymbol c) => c -> r
sy UnitalChunk
time))