Skip to content

Commit

Permalink
Moving simplified blocks and signals in files
Browse files Browse the repository at this point in the history
  • Loading branch information
masfaraud committed Oct 7, 2018
1 parent d8a28b7 commit 1146c5e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 42 deletions.
21 changes: 21 additions & 0 deletions bms/blocks/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,27 @@ def LabelConnections(self):
return ['', '']


class IntegrationBlock(ODE):
"""
Creates an ODE block that performs integration over time.
"""
def __init__(self, input_variable, output_variable):
ODE.__init__(self, input_variable, output_variable, a=[1], b=[0, 1])

def LabelBlock(self):
return 'Integral'

class DifferentiationBlock(ODE):
"""
Creates an ODE block that performs differentation relative to time.
"""
def __init__(self, input_variable, output_variable):
ODE.__init__(self, input_variable, output_variable, a=[0, 1], b=[1])

def LabelBlock(self):
return 'dx/dt'


class FunctionBlock(Block):
"""
output = f(input)
Expand Down
26 changes: 0 additions & 26 deletions bms/blocks/simplified_blocks.py

This file was deleted.

1 change: 1 addition & 0 deletions bms/signals/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def function(t):
return (t-delay) * amplitude + offset
self.function = function

unit_ramp = Ramp(amplitude = 1, name='Unit ramp')

class Sinus(Signal):
def __init__(self, name='Sinus', amplitude=1, w=1, phase=0, offset=0):
Expand Down
16 changes: 0 additions & 16 deletions bms/signals/simplified_signals.py

This file was deleted.

0 comments on commit 1146c5e

Please sign in to comment.