x.add_system('opt', opt, r'\text{Optimizer}') x.add_system('D1', ecomp, r'D_1') # can fade out blocks to allow for emphasis on sub-sections of XDSM x.add_system('D2', icomp, r'D_2', faded=True) # can fade out blocks to allow for emphasis on sub-sections of XDSM x.add_system('D3', icomp, r'D_3') # if you give the label as a list or tuple, it splits it onto multiple lines x.add_system('F', func, (r'F', r'\text{Functional}')) # stacked can be used to represent multiple instances that can be run in parallel x.add_system('G', func, r'G', stack=True) x.add_process(['opt', 'D1', 'D2', 'F', 'G', 'opt'], arrow=True) x.connect('opt', 'D1', r'x, z, y_2') x.connect('opt', 'D2', r'z, y_1') x.connect('opt', 'D3', r'z, y_1') x.connect('opt', 'F', r'x, z') x.connect('opt', 'F', r'y_1, y_2') # you can also stack variables x.connect('opt', 'G', r'y_1, y_2', stack=True) x.connect('D1', 'opt', r'\mathcal{R}(y_1)') x.connect('D2', 'opt', r'\mathcal{R}(y_2)') x.connect('F', 'opt', r'f') x.connect('G', 'opt', r'g', stack=True)
#x.connect('P', 'opt', r'\mathcal{R}(P)') x.connect('O', 'opt', r'f_{0}') x.connect('I', 'opt', r'c_{0}') x.connect('C', 'opt', r'c_{c}') x.add_input( 'opt', r'S_{e}^{0},b_{e}^{0},\lambda_{e}^{0},\Lambda_{LE}^{0},CST_{root}^{0},CST_{tip}^{0},\phi_{t}^{0},loc_{engines}^{0},\hat{MTOW}^{0},\hat{W_{f}}^{0},\hat{loading}^{0},\hat{L/D}{^0}' ) x.add_output( 'opt', r'S_{e}^{*},b_{e}^{*},\lambda_{e}^{*},\Lambda_{LE}^{*},CST_{root}^{*},CST_{tip}^{*},\phi_{t}^{*},loc_{engines}^{*},\hat{MTOW}^{*},\hat{W_{f}}^{*},\hat{loading}^{*},\hat{L/D}^{*}', side='left') x.add_output('A', r'L/D^{*}', side='left') x.add_output('L', r'loading^{*}', side='left') x.add_output('S', r'MTOW^{*}', side='left') x.add_output('P', r'W_{f}^{*}', side='left') #x.add_output('F', r'f^*', side='left') #x.add_output('G', r'g^*', side='left') x.add_process(['opt', 'A', 'C', 'opt']) x.add_process(['opt', 'L', 'C', 'opt']) x.add_process(['opt', 'S', 'C', 'opt']) x.add_process(['opt', 'S', 'I', 'opt']) x.add_process(['opt', 'P', 'C', 'opt']) x.add_process(['opt', 'P', 'I', 'opt']) x.add_process(['opt', 'P', 'O', 'opt']) x.write('mdf4')
x.connect('opt', 'solver', r'T^{t,(0)}') x.connect('opt', 'Qext', r'\Phi, \Psi, \Omega, \alpha') x.connect('opt', 'Power', r'P_{out}') x.connect('opt', 'Temp', r'\epsilon, k') x.connect('opt', 'Fun', r'P_{out}') x.connect('solver', 'Qext', 'T^t') x.connect('solver', 'Power', 'T^t') x.connect('Qext', 'Power', r'Q_{sun}') x.connect('Qext', 'Temp', r'Q_{sun}, Q_{planet}, Q_{alb}') x.connect('Qext', 'Temp', r'Q_{sun}, Q_{planet}, Q_{alb}') x.connect('Power', 'Temp', r'Q_{dis}') x.connect('Power', 'Fun', r'Q_{dis}, P_{el}') x.connect('Temp', 'solver', r'\mathcal{R}(T)') x.connect('Temp', 'Fun', 'T') x.connect('Fun', 'opt', 'f,c') #x.connect('G', 'opt', 'g') x.add_input('opt', r'x_0', stack=True) x.add_output('opt', 'x^*', side='left') x.add_output('Temp', 'T^*', side='left') x.add_output('Qext', r'Q_{sun}^*', side='left', stack=True) x.add_output('Fun', 'f^*, c^*', side='left') x.add_output('Power', r'Q_{dis}^*', side='left') x.add_process(['opt', 'solver', 'Qext', 'Power', 'Temp', 'solver'], arrow=True) x.add_process(['solver', 'Fun', 'opt'], arrow=True) x.write('mdf')
# can fade out blocks to allow for emphasis on sub-sections of XDSM x.add_system("D2", IFUNC, "D_2", faded=True) x.add_system("D3", IFUNC, "D_3") x.add_system("subopt", SUBOPT, "SubOpt") x.add_system("G1", GROUP, "G_1") x.add_system("G2", IGROUP, "G_2") x.add_system("MM", METAMODEL, "MM") # if you give the label as a list or tuple, it splits it onto multiple lines x.add_system("F", FUNC, ("F", r"\text{Functional}")) # stacked can be used to represent multiple instances that can be run in parallel x.add_system("H", FUNC, "H", stack=True) x.add_process(["opt", "DOE", "MDA", "D1", "D2", "subopt", "G1", "G2", "MM", "F", "H", "opt"], arrow=True) x.connect("opt", "D1", ["x", "z", "y_2"], label_width=2) x.connect("opt", "D2", ["z", "y_1"]) x.connect("opt", "D3", "z, y_1") x.connect("opt", "subopt", "z, y_1") x.connect("subopt", "G1", "z_2") x.connect("subopt", "G2", "z_2") x.connect("subopt", "MM", "z_2") x.connect("opt", "G2", "z") x.connect("opt", "F", "x, z") x.connect("opt", "F", "y_1, y_2") # you can also stack variables x.connect("opt", "H", "y_1, y_2", stack=True)
# can fade out blocks to allow for emphasis on sub-sections of XDSM x.add_system('D2', ifunc, 'D_2', faded=True) x.add_system('D3', ifunc, 'D_3') x.add_system('subopt', subopt, 'SubOpt') x.add_system('G1', group, 'G_1') x.add_system('G2', igroup, 'G_2') x.add_system('MM', metamodel, 'MM') # if you give the label as a list or tuple, it splits it onto multiple lines x.add_system('F', func, ('F', r'\text{Functional}')) # stacked can be used to represent multiple instances that can be run in parallel x.add_system('H', func, 'H', stack=True) x.add_process(['opt', 'DOE', 'MDA', 'D1', 'D2', 'subopt', 'G1', 'G2', 'MM', 'F', 'H', 'opt'], arrow=True) x.connect('opt', 'D1', ['x', 'z', 'y_2'], label_width=2) x.connect('opt', 'D2', ['z', 'y_1']) x.connect('opt', 'D3', 'z, y_1') x.connect('opt', 'subopt', 'z, y_1') x.connect('subopt', 'G1', 'z_2') x.connect('subopt', 'G2', 'z_2') x.connect('subopt', 'MM', 'z_2') x.connect('opt', 'G2', 'z') x.connect('opt', 'F', 'x, z') x.connect('opt', 'F', 'y_1, y_2') # you can also stack variables x.connect('opt', 'H', 'y_1, y_2', stack=True)
x.add_system('rotor', FUNC, r'\text{RotorSE}') x.add_system('drive', FUNC, r'\text{DrivetrainSE}') x.add_system('tower', FUNC, r'\text{TowerSE}') x.add_system('CSM', FUNC, r'\text{NREL CSM}') x.add_system('BOS', FUNC, r'\text{LandBOSSE}') x.add_system('costs', FUNC, r'\text{Plant\_FinanceSE}') # Feed-forward connections; from, to, name for connections x.connect('opt', 'rotor', r'\text{Blade design variables}') x.connect('rotor', 'drive', r'\text{Performance, loads}') x.connect('rotor', 'BOS', r'\text{Rotor and blade mass}') x.connect('drive', 'tower', (r'\text{Forces, moments,}', r'\text{mass properties}')) x.connect('tower', 'CSM', r'\text{Tower mass}') x.connect('drive', 'CSM', r'\text{Drivetrain mass}') x.connect('rotor', 'CSM', r'\text{Rotor mass}') x.connect('CSM', 'BOS', r'\text{Turbine mass and costs}') x.connect('BOS', 'costs', r'\text{BOS costs}') # Feed-backward connections x.connect('drive', 'rotor', r'\text{Efficiency}') x.connect('costs', 'opt', r'\text{Cost and profit values}') x.connect('tower', 'opt', (r'\text{Tower stress and}', r'\text{buckling values}')) x.connect('rotor', 'opt', (r'\text{Blade tip deflection,}', r'\text{blade strains}')) # Outputs on the left-hand side # x.add_output('opt', 'x^*, z^*', side='left') x.add_process(["opt", "rotor", "drive", "tower", "CSM", "BOS", "costs", "opt"]) # Compile latex and write pdf x.write('xdsm_wisdem')