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
module Main where | |
import Data.Maybe | |
import Text.Printf | |
import Text.Regex.Posix | |
-- The main function defines what the program does when we compile it. | |
main = do | |
-- Read all data from standard input (until the end of the file). | |
file <- getContents |
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
# Step response graphs | |
# Python 2.7 with numpy, scipy, and matplotlib | |
# Based on https://gist.github.com/ofan666/1882562 | |
from numpy import min as nmin | |
from scipy import linspace | |
from scipy.signal import lti, step | |
from matplotlib import pyplot as p | |
def create_tf(i): |
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
# Step response graphs | |
# Python 2.7 with numpy, scipy, and matplotlib | |
# Based on https://gist.github.com/ofan666/1882562 | |
from numpy import min as nmin | |
from scipy import linspace | |
from scipy.signal import lti, step | |
from matplotlib import pyplot as p | |
def plotLTI(num, den, n = 200): |
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
module Alphabet ( | |
Alphabet, | |
encodeWithAlphabet, | |
decodeFromAlphabet | |
) where | |
import Prelude | |
import Data.List(elemIndex, mapAccumR) | |
import Data.Maybe(fromMaybe) |
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
-- Main module so that this file can be compiled. | |
module Main where | |
-- Import module defined in StressAnalysis.hs (https://gist.github.com/3979818) | |
import StressAnalysis | |
-- Main function detemermines what the compiled executable does. | |
-- At the moment, I want to graph the stress at each element of a section. | |
main = graphElements |
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
-- Define a module with the same name as the file. | |
module StressAnalysis where | |
-- A Beam is defined by its geometry. Think of this as a class declaration. | |
data Beam = Circle { | |
diameter :: Float -- Member named 'diameter' of type 'Float' | |
} deriving (Show) | |
-- Define functions for common properties of beams. The functions are | |
-- impleented down the bottom of the file. These functions take a Beam and |
NewerOlder