コード例 #1
0
ファイル: IDF.py プロジェクト: a-deblois/XDSM
def make_IDF_XDSM():

    dsm = XDSM()
    ad = lambda *args, **kargs: dsm.addComp(*args, **kargs)
    co = lambda *args, **kargs: dsm.addDep(*args, **kargs)

    # add diagnol (Component) in order from up to down

    ad('EMPTY', 'Analysis', '')
    #all 'EMPTY' heading name component is used for Input and output,
    # the component will not be shown,
    # here used for upper input and left output
    ad('opt', 'Optimization', r'$0,3\to 1$:\\Optimization')
    ad('ana', 'Analysis, stack', r'$1$\\Analysis $i$')
    ad('fun', 'Function', r'$2$\\Functions')

    #add dependency variables, here order free
    co('opt', 'EMPTY', 'DataInter',
       r'$\mathbf{x}^{(0)}, \hat{\mathbf{y}}^{(0)}$')
    co('EMPTY', 'opt', 'DataInter',
       r'$x^*$')
    co('ana', 'opt', 'DataInter',
       r'$1:\mathbf{x}_0, \mathbf{x}_i, \hat{\mathbf{y}}_{j\neq i}$')
    co('EMPTY', 'ana', 'DataInter,stack',
       r'$\mathbf{y}_i^*$')
    co('fun', 'opt', 'DataInter',
       r'$2:\mathbf{x}, \hat{\mathbf{y}}$')
    co('fun', 'ana', 'DataInter, stack',
       r'$2:\mathbf{y}_i$')
    co('opt', 'fun', 'DataInter',
       '$3:f_0,\mathbf{c}, \mathbf{c}^c$')

    # component name from start to the end in turn
    dsm.addChain([
        'opt-EMPTY', 'opt', 'ana', 'fun', 'opt', 'EMPTY-opt'])
    #the dependency node using "downstream_component-upstream_component"

    # output tex file and compile it
    dsm.write(r'IDF.pdf', compilepdf=True)
コード例 #2
0
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'

x = XDSM()

x.addComp('Optimizer', 'Analysis', 'Optimizer')
x.addComp('solver', 'MDA', 'Solver')
x.addComp('C1', opt, 'C1')
x.addComp('C2', opt, 'C2')
x.addComp('C3', opt, 'C3')

x.addDep('C1', 'solver', dat, "$y_1$")
x.addDep('C2', 'C1', dat, "$y_2$")
x.addDep('solver', 'C2', dat, "$y_1$")
x.addDep('C3', 'C2', dat, "$y_1$")

x.addDep('C1', 'Optimizer', dat, "$x_1$")
x.addDep('C3', 'Optimizer', dat, "$x_2$")
x.addDep('Optimizer', 'C3', dat, "$f$")

x.write('total_v_partial', True)
コード例 #3
0
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'
mda = 'MDA'
anl = 'Analysis'

x = XDSM()
#x.addComp('driver', mda, 'Solver')
x.addComp('assembly inputs', anl, 'assembly inputs')
x.addComp('compress', anl, 'compress')
x.addComp('mission', anl, 'mission')
x.addComp('pod', anl, 'pod')
x.addComp('flow_limit', anl, 'flow\_limit')
x.addComp('tube_wall_temp', anl, 'tube\_wall\_temp')

x.addDep('mission', 'compress', dat, '', stack=True)
x.addDep('pod', 'compress', dat, '', stack=True)
x.addDep('pod', 'mission', dat, '', stack=True)
x.addDep('flow_limit', 'pod', dat, '', stack=True)
x.addDep('tube_wall_temp', 'compress', dat, '', stack=True)

#reverse couplings
x.addDep('compress', 'flow_limit', dat, '', stack=True)
x.addDep('compress', 'tube_wall_temp', dat, '', stack=True)
x.addDep('compress', 'pod', dat, '', stack=True)

#assembly inputs
x.addDep('compress', 'assembly inputs', dat, '', stack=True)
x.addDep('mission', 'assembly inputs', dat, '', stack=True)
x.addDep('flow_limit', 'assembly inputs', dat, '', stack=True)
コード例 #4
0
from XDSM import XDSM

opt = 'Optimization'
anl = 'Analysis'
dat = 'DataInter'

x = XDSM()
x.addComp('Optimizer', opt, 'Optimizer')
x.addComp('Solver', 'MDA', 'Solver')
x.addComp('A', anl, 'A')
x.addComp('B', anl, 'B')


x.addDep('A', 'Optimizer', dat, 'x', True)
x.addDep('Solver', 'B', dat, 'y2')
x.addDep('Solver', 'A', dat, 'y1')
x.addDep('A', 'Solver', dat, 'y2')
x.addDep('B', 'Solver', dat, 'y1')
x.addDep('Optimizer','B', dat, 'z')


x.write('mdf_sample',True)
コード例 #5
0
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'

Large="\Large "

def build_levitation(xdsm):

    x.addComp('Drag', 'Function', Large + r'\TwolineComponent{6em}{BreakPoint}{Drag}')
    x.addComp('MDrag', 'Function', Large + r'\TwolineComponent{6em}{Magnetic}{Drag}')
    x.addComp('Mass', 'Function', Large + r'\TwolineComponent{6em}{Magnetic}{Mass}')

    x.addDep('MDrag', 'Drag', dat, r"$R_\text{track}, L_\text{track}, \lambda, w_\text{pod}$")

x = XDSM()
build_levitation(x)
x.write('levitation',True)
コード例 #6
0
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'

Large="\Large "

def build_steady_state_vacuum(xdsm):

    x.addComp('Fl_Start', 'Function', Large + r'\TwolineComponent{6em}{Flow}{Start}')
    x.addComp('Compressor', 'Analysis', Large + r'Compressor')

    x.addDep('Compressor', 'Fl_Start', dat, r"$Fl_\text{total}, Fl_\text{static}$")

x = XDSM()
build_steady_state_vacuum(x)
x.write('steady_state_vacuum',True)
コード例 #7
0
ファイル: pod_xdsm.py プロジェクト: BoltzmannBrain/Hyperloop
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'
mda = 'MDA'
anl = 'Analysis'

x = XDSM()

name = 'assembly inputs'
x.addComp(name, anl, name)
name = 'capsule'
x.addComp(name, anl, name)
name = 'tube'
x.addComp(name, anl, name)
name = 'battery'
x.addComp(name, anl, name)
name = 'inlet'
x.addComp(name, anl, name)
name = 'aero'
x.addComp(name, anl, name)
name = 'assembly outputs'
x.addComp(name, anl, name)

x.addDep('inlet', 'assembly inputs', dat, '', stack=True)
x.addDep('aero', 'assembly inputs', dat, '', stack=True)
x.addDep('battery', 'assembly inputs', dat, '', stack=True)
x.addDep('tube', 'assembly inputs', dat, '', stack=True)

x.addDep('inlet', 'capsule', dat, '', stack=True)
x.addDep('battery', 'capsule', dat, '', stack=True)
コード例 #8
0
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'
mda = 'MDA'
anl = 'Analysis'

x = XDSM()

names = ['assembly inputs', 'tube', 'inlet' , 'comp1', 'duct1', 'split', 'nozzle', 
         'comp2', 'duct2', 'perf', 'assembly outputs']
for name in names: 
    x.addComp(name, anl, name)

x.addDep('tube', 'assembly inputs', dat, '', stack=True)
x.addDep('inlet', 'assembly inputs', dat, '', stack=True)
x.addDep('comp1', 'assembly inputs', dat, '', stack=True)
x.addDep('split', 'assembly inputs', dat, '', stack=True)
x.addDep('comp2', 'assembly inputs', dat, '', stack=True)
x.addDep('perf', 'assembly inputs', dat, '', stack=True)

x.addDep('inlet', 'tube', dat, '', stack=True)
x.addDep('comp1', 'inlet', dat, '', stack=True)
x.addDep('duct1', 'comp1', dat, '', stack=True)
x.addDep('split', 'duct1', dat, '', stack=True)
x.addDep('nozzle', 'split', dat, '', stack=True)
x.addDep('comp2', 'split', dat, '', stack=True)
x.addDep('duct2', 'comp2', dat, '', stack=True)
x.addDep('perf', 'nozzle', dat, '', stack=True)
x.addDep('perf', 'comp2', dat, '', stack=True)
x.addDep('comp2', 'perf', dat, '', stack=True)
コード例 #9
0
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'
mda = 'MDA'
anl = 'Analysis'

x = XDSM()

name = 'assembly inputs'
x.addComp(name, anl, name)
name = 'capsule'
x.addComp(name, anl, name)
name = 'tube'
x.addComp(name, anl, name)
name = 'battery'
x.addComp(name, anl, name)
name = 'inlet'
x.addComp(name, anl, name)
name = 'aero'
x.addComp(name, anl, name)
name = 'assembly outputs'
x.addComp(name, anl, name)

x.addDep('inlet', 'assembly inputs', dat, '', stack=True)
x.addDep('aero', 'assembly inputs', dat, '', stack=True)
x.addDep('battery', 'assembly inputs', dat, '', stack=True)
x.addDep('tube', 'assembly inputs', dat, '', stack=True)

x.addDep('inlet', 'capsule', dat, '', stack=True)
x.addDep('battery', 'capsule', dat, '', stack=True)
コード例 #10
0
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'

Large = "\Large "


def build_drivetrain(xdsm):

    x.addComp('Motor', 'Analysis', Large + r'Motor')
    x.addComp('Inverter', 'Function', Large + r'Inverter')
    x.addComp('Battery', 'Function', Large + r'Battery')

    x.addDep('Inverter', 'Motor', dat, r"$I_\text{phase}, V_\text{phase}, f$")
    x.addDep('Battery', 'Inverter', dat, r"$I_\text{input}, Pwr_\text{input}$")


x = XDSM()
build_drivetrain(x)
x.write('drivetrain', True)
コード例 #11
0
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'

Large = "\Large "


def build_motor(xdsm):

    x.addComp('MotorSize', 'Function', Large + r'Motor Size')
    x.addComp('Solver', 'MDA', Large + 'Solver')
    x.addComp('MotorBalance', 'Function', Large + r'Motor Balance')
    x.addComp('Motor', 'Function', Large + r'Motor')

    x.addDep(
        'Motor', 'MotorSize', dat,
        r"\TwolineComponent{16em}{$\tau_\text{max}, Pwr_\text{mech}, \omega_\text{operating}$}{$Pwr_\text{iron loss}, R_\text{winding}, Pwr_\text{windage loss}$}"
    )
    x.addDep('MotorBalance', 'Motor', dat, r"$I, V, Pwr_\text{motor input}$")
    x.addDep('Motor', 'Solver', dat, r"$I_\text{no load}$")
    x.addDep('Solver', 'MotorBalance', dat, r"$\mathcal{R}(I_\text{no load})$")


x = XDSM()
build_motor(x)
x.write('motor', True)
コード例 #12
0
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'

Large = "\Large "


def build_cycle(xdsm):

    x.addComp('FlowpathInp', 'Function',
              Large + r'\TwolineComponent{6em}{Flowpath}{Inputs}')
    x.addComp('Flowpath', 'Analysis', Large + r'Flowpath')
    x.addComp('CompLen', 'Function',
              Large + r'\TwolineComponent{6em}{Compressor}{Length}')
    x.addComp('CompMass', 'Function',
              Large + r'\TwolineComponent{6em}{Compressor}{Mass}')

    x.addDep('Flowpath', 'FlowpathInp', dat,
             r"$P_\text{total}, T_\text{total}, \dot{m}$")
    x.addDep('CompMass', 'Flowpath', dat,
             r"$\dot{m}, h_\text{in}, h_\text{out}$")
    x.addDep('CompLen', 'Flowpath', dat, r"$h_\text{in}, h_\text{out}$")


x = XDSM()
build_cycle(x)
x.write('cycle', True)
コード例 #13
0
ファイル: motor_xdsm.py プロジェクト: JustinSGray/MagnePlane
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'

Large="\Large "

def build_motor(xdsm):

    x.addComp('MotorSize', 'Function', Large + r'Motor Size')
    x.addComp('Solver', 'MDA', Large + 'Solver')
    x.addComp('MotorBalance', 'Function', Large + r'Motor Balance')
    x.addComp('MotorPower', 'Function', Large + r'Motor Power')

    x.addDep('MotorPower', 'MotorSize', dat, r"\TwolineComponent{16em}{$\tau_\text{max}, Pwr_\text{mech}, \omega_\text{operating}$}{$Pwr_\text{iron loss}, R_\text{winding}, Pwr_\text{windage loss}$}")
    x.addDep('MotorBalance', 'MotorPower', dat, r"$I, V, Pwr_\text{motor input}$")
    x.addDep('MotorPower', 'Solver', dat, r"$I_\text{no load}$")
    x.addDep('Solver', 'MotorBalance', dat, r"$\mathcal{R}(I_\text{no load})$")

x = XDSM()
build_motor(x)
x.write('motor',True)
コード例 #14
0
ファイル: tube_xdsm.py プロジェクト: goldanguyen/MagnePlane

def build_tube(xdsm):

    x.addComp('SubTube', 'Function',
              Large + r'\TwolineComponent{6em}{Submerged}{Tube}')
    x.addComp('Temp', 'Analysis',
              Large + r'\TwolineComponent{6em}{Tube}{Temperature}')
    x.addComp('PropMech', 'Function',
              Large + r'\TwolineComponent{6em}{Propulsion}{Mechanics}')
    x.addComp('SSVacuum', 'Analysis',
              Large + r'\TwolineComponent{6em}{Steady State}{Vacuum}')
    x.addComp('Vacuum', 'Function', Large + r'Vacuum')
    x.addComp('Power', 'Function', Large + r'Tube Power')
    x.addComp('TubePylon', 'Function',
              Large + r'\TwolineComponent{6em}{Tube}{and Pylon}')

    x.addDep('PropMech', 'Temp', dat, r"$T_\text{tube}$")
    x.addDep('SSVacuum', 'Temp', dat, r"$T_\text{tube}$")
    x.addDep('Power', 'Temp', dat, r"$T_\text{tube}$")

    x.addDep('Power', 'PropMech', dat, r"$Pwr_\text{required}$")

    x.addDep('Power', 'Vacuum', dat, r"$E_\text{total}, Pwr_\text{total}$")
    x.addDep('TubePylon', 'Vacuum', dat, r"$w_\text{total}$")


x = XDSM()
build_tube(x)
x.write('tube', True)
コード例 #15
0
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'

x = XDSM()

x.addComp('Optimizer', 'Analysis', 'Optimizer')
x.addComp('C1', opt, 'C1')
x.addComp('solver', 'MDA', 'Solver')
x.addComp('C3', opt, 'C3')
x.addComp('C4', opt, 'C4')
x.addComp('C5', opt, 'C5')

x.addDep('C4', 'C1', dat, "")

x.addDep('C4', 'C3', dat, "")
x.addDep('C3', 'solver', dat, "")
x.addDep('C4', 'C3', dat, "")
x.addDep('solver', 'C4', dat, "")
x.addDep('C5', 'C4', dat, "")


x.addDep('C1', 'Optimizer', dat, "")
x.addDep('C3', 'Optimizer', dat, "")
x.addDep('Optimizer', 'C5', dat, "")




x.write('mixed_derivs_sample_xdsm',True)
コード例 #16
0
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'

x = XDSM()
x.addComp('Optimizer', 'Analysis', 'Optimizer')
x.addComp('Orbit', opt, 'Orbit Dynamics')
x.addComp('Attitude', opt, 'Attitude Dynamics')
x.addComp('Solar', opt, 'Cell Illumination')
x.addComp('Thermal', opt, 'Temperature')
x.addComp('Electrical', opt, 'Solar Power')
x.addComp('Battery', opt, 'Energy Storage')
x.addComp('Comm', opt, 'Communication')

x.addDep('Optimizer', 'Battery', dat, 'Constraints')
x.addDep('Optimizer', 'Comm', dat, 'Data downloaded')
x.addDep('Attitude', 'Optimizer', dat, 'Roll angle')
x.addDep('Solar', 'Attitude', dat, 'Attitude')
x.addDep('Solar', 'Orbit', dat, 'Position')
x.addDep('Thermal', 'Solar', dat, 'Exp. area')
x.addDep('Thermal', 'Optimizer', dat, 'Comm power')
x.addDep('Electrical', 'Solar', dat, 'Exp. area')
x.addDep('Electrical', 'Optimizer', dat, 'Panel current')
x.addDep('Electrical', 'Thermal', dat, 'Temperature')
x.addDep('Battery', 'Electrical', dat, 'Solar power')
x.addDep('Battery', 'Thermal', dat, 'Temperature')
x.addDep('Battery', 'Attitude', dat, 'Actuator power')
x.addDep('Battery', 'Optimizer', dat, 'Comm power')
x.addDep('Comm', 'Attitude', dat, 'Attitude')
x.addDep('Comm', 'Orbit', dat, 'Position')
コード例 #17
0
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'

Large="\Large "

def build_flowpath(xdsm):

    x.addComp('Fl_Start', 'Function', Large + r'\TwolineComponent{6em}{Flow}{Start}')
    x.addComp('Inlet', 'Function', Large + r'Inlet')
    x.addComp('Compressor', 'Analysis', Large + r'Compressor')
    x.addComp('Duct', 'Function', Large + r'Duct')
    x.addComp('Nozzle', 'Function', Large + r'Nozzle')
    x.addComp('Shaft', 'Function', Large + r'Shaft')

    x.addDep('Inlet', 'Fl_Start', dat, r"$Fl_\text{total}, Fl_\text{static}$")
    x.addDep('Compressor', 'Inlet', dat, r"$Fl_\text{total}, Fl_\text{static}$")
    x.addDep('Duct','Compressor',  dat, r"$Fl_\text{total}, Fl_\text{static}$")
    x.addDep('Nozzle','Duct', dat, r"$Fl_\text{total}, Fl_\text{static}$")
    x.addDep('Shaft','Compressor', dat, r"$trq$")
    x.addDep('Compressor','Shaft', dat, r"$N_\text{mech}$")

x = XDSM()
build_flowpath(x)
x.write('flowpath',True)
コード例 #18
0

def build_pod(xdsm):

    x.addComp('Cycle', 'Analysis', Large + r'Cycle')
    x.addComp('Drivetrain', 'Analysis', Large + r'Drivetrain')
    x.addComp('Geometry', 'Function', Large + r'Geometry')
    x.addComp('Pod Mach', 'Function', Large + r'Pod Mach')
    x.addComp('Mass', 'Function', Large + r'Mass')
    x.addComp('Levitation', 'Function', Large + r'Levitation')

    x.addDep('Geometry', 'Cycle', dat, r"$L_\text{comp}, A_\text{pod duct}$")
    x.addDep('Mass', 'Cycle', dat, r"$m_\text{comp}$")
    x.addDep('Drivetrain', 'Cycle', dat,
             r"$\tau_\text{comp}, Pwr_\text{comp}$")

    x.addDep('Mass', 'Drivetrain', dat, r"$m_\text{battery}, m_\text{motor}$")
    x.addDep('Geometry', 'Drivetrain', dat,
             r"$L_\text{battery}, L_\text{motor}$")

    x.addDep('Pod Mach', 'Geometry', dat, r"$A_\text{pod}, L_\text{pod}$")
    x.addDep('Mass', 'Geometry', dat, r"$L_\text{pod}, D_\text{pod}, BF$")
    x.addDep('Levitation', 'Geometry', dat, r"$L_\text{pod}, D_\text{pod}$")

    x.addDep('Levitation', 'Mass', dat, r"$m_\text{pod}$")


x = XDSM()
build_pod(x)
x.write('pod', True)
コード例 #19
0
ファイル: pod_xdsm.py プロジェクト: goldanguyen/MagnePlane
opt = 'Optimization'
dat = 'DataInter'

Large="\Large "

def build_pod(xdsm):

    x.addComp('Cycle', 'Analysis', Large + r'Cycle')
    x.addComp('Drivetrain', 'Analysis', Large + r'Drivetrain')
    x.addComp('Geometry', 'Function', Large + r'Geometry')
    x.addComp('Pod Mach', 'Function', Large + r'Pod Mach')
    x.addComp('Mass', 'Function', Large + r'Mass')
    x.addComp('Levitation', 'Function', Large + r'Levitation')

    x.addDep('Geometry', 'Cycle', dat, r"$L_\text{comp}, A_\text{pod duct}$")
    x.addDep('Mass', 'Cycle', dat, r"$m_\text{comp}$")
    x.addDep('Drivetrain', 'Cycle', dat, r"$\tau_\text{comp}, Pwr_\text{comp}$")

    x.addDep('Mass', 'Drivetrain', dat, r"$m_\text{battery}, m_\text{motor}$")
    x.addDep('Geometry', 'Drivetrain', dat, r"$L_\text{battery}, L_\text{motor}$")

    x.addDep('Pod Mach', 'Geometry', dat, r"$A_\text{pod}, L_\text{pod}$")
    x.addDep('Mass', 'Geometry', dat, r"$L_\text{pod}, D_\text{pod}, BF$")
    x.addDep('Levitation', 'Geometry', dat, r"$L_\text{pod}, D_\text{pod}$")

    x.addDep('Levitation', 'Mass', dat, r"$m_\text{pod}$")

x = XDSM()
build_pod(x)
x.write('pod',True)
コード例 #20
0
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'
mda = 'MDA'
anl = 'Analysis'

x = XDSM()

names = [
    'assembly inputs', 'tube', 'inlet', 'comp1', 'duct1', 'split', 'nozzle',
    'comp2', 'duct2', 'perf', 'assembly outputs'
]
for name in names:
    x.addComp(name, anl, name)

x.addDep('tube', 'assembly inputs', dat, '', stack=True)
x.addDep('inlet', 'assembly inputs', dat, '', stack=True)
x.addDep('comp1', 'assembly inputs', dat, '', stack=True)
x.addDep('split', 'assembly inputs', dat, '', stack=True)
x.addDep('comp2', 'assembly inputs', dat, '', stack=True)
x.addDep('perf', 'assembly inputs', dat, '', stack=True)

x.addDep('inlet', 'tube', dat, '', stack=True)
x.addDep('comp1', 'inlet', dat, '', stack=True)
x.addDep('duct1', 'comp1', dat, '', stack=True)
x.addDep('split', 'duct1', dat, '', stack=True)
x.addDep('nozzle', 'split', dat, '', stack=True)
x.addDep('comp2', 'split', dat, '', stack=True)
x.addDep('duct2', 'comp2', dat, '', stack=True)
x.addDep('perf', 'nozzle', dat, '', stack=True)
コード例 #21
0
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'

Large="\Large "

def build_flowpath(xdsm):

    x.addComp('Fl_Start', 'FunctionGroup', Large + r'Flow Start')
    x.addComp('Inlet', 'FunctionGroup', Large + r'Inlet')
    x.addComp('Compressor', 'AnalysisGroup', Large + r'Compressor')
    x.addComp('Duct', 'FunctionGroup', Large + r'Duct')
    x.addComp('Nozzle', 'FunctionGroup', Large + r'Nozzle')
    x.addComp('Shaft', 'FunctionGroup', Large + r'Shaft')

    x.addDep('Inlet', 'Fl_Start', dat, r"$Fl_\text{total}, Fl_\text{static}$")
    x.addDep('Compressor', 'Inlet', dat, r"$Fl_\text{total}, Fl_\text{static}$")
    x.addDep('Duct','Compressor',  dat, r"$Fl_\text{total}, Fl_\text{static}$")
    x.addDep('Nozzle','Duct', dat, r"$Fl_\text{total}, Fl_\text{static}$")
    x.addDep('Shaft','Compressor', dat, r"$trq$")
    x.addDep('Compressor','Shaft', dat, r"$N_\text{mech}$")

x = XDSM()
build_flowpath(x)
x.write('flowpath',True)
コード例 #22
0
ファイル: tube_xdsm.py プロジェクト: JustinSGray/MagnePlane
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'

Large="\Large "

def build_tube(xdsm):

    x.addComp('Temp', 'AnalysisGroup', Large + r'\TwolineComponent{6em}{Tube}{Temperature}')
    x.addComp('PropMech', 'Function', Large + r'\TwolineComponent{6em}{Propulsion}{Mechanics}')
    x.addComp('Vacuum', 'FunctionGroup', Large + r'Vacuum')
    x.addComp('Power', 'Function', Large + r'Tube Power')
    x.addComp('Structure', 'FunctionGroup', Large + r'Structure')

    x.addDep('PropMech', 'Temp', dat, r"$T_\text{tube}$")
    x.addDep('Vacuum', 'Temp', dat, r"$T_\text{tube}$")
    x.addDep('Power', 'Temp', dat, r"$T_\text{tube}$")

    x.addDep('Power', 'PropMech', dat, r"$Pwr_\text{required}$")

    x.addDep('Power', 'Vacuum', dat, r"$E_\text{total}, Pwr_\text{total}$")
    x.addDep('Structure', 'Vacuum', dat, r"$w_\text{total}$")

x = XDSM()
build_tube(x)
x.write('tube',True)
コード例 #23
0
ファイル: cycle_xdsm.py プロジェクト: goldanguyen/MagnePlane
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'

Large="\Large "

def build_cycle(xdsm):

    x.addComp('FlowpathInp', 'Function', Large + r'\TwolineComponent{6em}{Flowpath}{Inputs}')
    x.addComp('Flowpath', 'Analysis', Large + r'Flowpath')
    x.addComp('CompLen', 'Function', Large + r'\TwolineComponent{6em}{Compressor}{Length}')
    x.addComp('CompMass', 'Function', Large + r'\TwolineComponent{6em}{Compressor}{Mass}')

    x.addDep('Flowpath', 'FlowpathInp', dat, r"$P_\text{total}, T_\text{total}, \dot{m}$")
    x.addDep('CompMass', 'Flowpath', dat, r"$\dot{m}, h_\text{in}, h_\text{out}$")
    x.addDep('CompLen', 'Flowpath', dat, r"$h_\text{in}, h_\text{out}$")

x = XDSM()
build_cycle(x)
x.write('cycle',True)
コード例 #24
0
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'

Large="\Large "

def build_tubepod(xdsm): 
    x.addComp('solver', 'MDA', Large + 'Solver')

    x.addComp('Tube', 'Function', Large + r'Tube')
    x.addComp('Pod', 'Function', Large + r'Pod')

    x.addDep('Tube', 'Pod', dat, "$n, b, b_o$")
    x.addDep('Pod', 'Tube', dat, "$n, b, b_o$")

x = XDSM()
build_tubepod(x)
x.write('tube_and_pod',True)
コード例 #25
0
    x.addDep('solver', 'ChemEq', dat, r"$\mathcal{R}_\text{Gibbs}, \mathcal{R}_\text{mass}$")
    x.addDep('Cp', 'ChemEq', dat, "$n, b, b_o$")
    x.addDep('Cv', 'ChemEq', dat, "$n, b, b_o$")
    x.addDep('props', 'ChemEq', dat, "$n$")
    x.addDep('props', 'Cp', dat, "$C_P$")
    x.addDep('props', 'Cv', dat, "$C_V$")

# x.addDep('aero', 'prop', dat, "Mass Flow")
# x.addDep('solver', 'aero', dat, "Drag")
# x.addDep('solver', 'prop', dat, "Thrust")
# x.addDep('prop', 'solver', dat, "Throttle")

# x.addDep('aero', 'opt', dat, "OML Shape")
# x.addDep('prop', 'opt', dat, "Engine Size")

# x.addDep('opt', 'prop', dat, "TSFC")


x = XDSM()
build_chemeq(x)
x.write('chem_eq_xdsm',True)

# x = XDSM()
# x.addComp('opt', 'Optimization', Large + 'Optimizer')
# build_chemeq(x)
# x.addDep('ChemEq', 'opt', dat, "$P,\phi$")
# x.addDep('opt', 'props', dat, r"$T, \frac{dT}{dP}, \frac{dT}{d\phi}$")
# x.write('opt_chem_eq_xdsm',True)


コード例 #26
0
ファイル: temp_xdsm.py プロジェクト: JustinSGray/MagnePlane
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'

Large="\Large "

def build_temp(xdsm):

    x.addComp('Solver', 'MDA', Large + 'Solver')
    x.addComp('TempBal', 'Function', Large + '\TwolineComponent{6em}{Temp}{Balance}')
    x.addComp('TubeWallTemp', 'Function', Large + r'\TwolineComponent{6em}{Tube Wall}{Temp}')

    x.addDep('TubeWallTemp', 'Solver', dat, r"$T_\text{boundary}$")
    x.addDep('Solver', 'TempBal', dat, r"$\mathcal{R}(T_\text{boundary})$")
    x.addDep('TempBal', 'TubeWallTemp', dat, r"$T_\text{ss residual}$")

x = XDSM()
build_temp(x)
x.write('temp',True)
コード例 #27
0
ファイル: overall.py プロジェクト: JustinSGray/Seedling2015
from XDSM import XDSM

opt = 'Optimization'
anl = 'Analysis'
dat = 'DataInter'

x = XDSM()
x.addComp('opt', opt, 'Optimizer')
#x.addComp('sol', 'MDA', 'Solver')
x.addComp('geom', anl, 'Geometry')
x.addComp('prop', anl, 'Propeller')
x.addComp('aero', anl, 'Aerodynamics')
x.addComp('struct', anl, 'Structures')
x.addComp('dyn', anl, 'Dynamics')

x.addDep('opt', 'prop', dat, '$Pwr$', False)
x.addDep('opt', 'dyn', dat, '$Disp_{dynamic}$', False)
x.addDep('opt', 'struct', dat, '$stress$', False)



x.addDep('geom', 'opt', dat, '\ThreelineComponent{2.55cm}{$s, c_{prop},$}{$twist_{prop}, D_{Prop}$}{$c_{wing},twist_{wing}$}', False)
x.addDep('prop', 'geom', dat, '$mesh_{prop}$', False)
x.addDep('aero', 'geom', dat, '$mesh_{wing}$', False)
x.addDep('struct', 'geom', dat, '$mesh_{wing}$', False)

x.addDep('prop', 'opt', dat, '$D_{prop}$', False)
x.addDep('aero', 'opt', dat, '\TwolineComponent{2.55cm}{$s, c_{wing},$}{$twist_{wing}, D_{Prop}$}', False)
x.addDep('struct', 'opt', dat, '$Thk$', False)
x.addDep('prop', 'opt', dat, 'RPM', False)
コード例 #28
0
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'

x = XDSM()
x.addComp('Optimizer', 'Analysis', 'Optimizer')
x.addComp('Orbit', opt, 'Orbit Dynamics')
x.addComp('Attitude', opt, 'Attitude Dynamics')
x.addComp('Solar', opt, 'Cell Illumination')
x.addComp('Thermal', opt, 'Temperature')
x.addComp('Electrical', opt, 'Solar Power')
x.addComp('Battery', opt, 'Energy Storage')
x.addComp('Comm', opt, 'Communication')

x.addDep('Optimizer', 'Battery', dat, '')
x.addDep('Optimizer', 'Comm', dat, '')
x.addDep('Attitude', 'Optimizer', dat, '')
x.addDep('Solar', 'Attitude', dat, '')
x.addDep('Solar', 'Orbit', dat, '')
x.addDep('Thermal', 'Solar', dat, '')
x.addDep('Thermal', 'Optimizer', dat, '')
x.addDep('Electrical', 'Solar', dat, '')
x.addDep('Electrical', 'Optimizer', dat, '')
x.addDep('Electrical', 'Thermal', dat, '')
x.addDep('Battery', 'Electrical', dat, '')
x.addDep('Battery', 'Thermal', dat, '')
x.addDep('Battery', 'Attitude', dat, '')
x.addDep('Battery', 'Optimizer', dat, '')
x.addDep('Comm', 'Attitude', dat, '')
x.addDep('Comm', 'Orbit', dat, '')
コード例 #29
0
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'

Large="\Large "

def build_drivetrain(xdsm):

    x.addComp('Motor', 'AnalysisGroup', Large + r'Motor')
    x.addComp('Inverter', 'Function', Large + r'Inverter')
    x.addComp('Battery', 'Function', Large + r'Battery')

    x.addDep('Inverter', 'Motor', dat, r"$I_\text{phase}, V_\text{phase}, f$")
    x.addDep('Battery', 'Inverter', dat, r"$I_\text{input}, Pwr_\text{input}$")

x = XDSM()
build_drivetrain(x)
x.write('drivetrain',True)
コード例 #30
0
ファイル: wt_xdsm.py プロジェクト: JustinSGray/mao_cadre_2014
from XDSM import XDSM

opt = 'Optimization'
dat = 'DataInter'

x = XDSM()
x.addComp('Optimizer', 'Analysis', 'Optimizer')

x.addComp('solver', 'MDA', 'Solver')

x.addComp('rotor', opt, 'Rotor')
x.addComp('hub', opt, 'Hub')
x.addComp('nacelle', opt, 'Nacelle')
x.addComp('tower', opt, 'Tower')
x.addComp('deflection', opt, 'Tower Strike')
x.addComp('aep_a', opt, 'Annual Energy Prod.')
x.addComp('opex_a', opt, 'Op. Expenses')
x.addComp('tcc_a', opt, 'Turb. Capital Cost')
x.addComp('bos_a', opt, 'Balance of Station')
x.addComp('fin_a', opt, 'Financial')


x.addDep('rotor', 'solver', dat, "$L_{blade}, precurve$")
x.addDep('solver', 'rotor', dat, "$\Delta_{L}, \Delta_{precurve}$")

x.addDep('tcc_a', 'rotor', dat, '$m_{blade}$, $P_{rated}$')
x.addDep('tcc_a', 'hub', dat, '$m_{hub}$')
x.addDep('tcc_a', 'nacelle', dat, '$m_{nacelle}$')
x.addDep('tcc_a', 'tower', dat, '$m_{tower}$')

x.addDep('bos_a', 'rotor', dat, '\TwolineComponent{2.5cm}{$m_{blade}$, $P_{rated}$}{$d_{rotor}$}')