-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added long_description read from README * black format * flake8 fixes * version bump * removed extra white spaces * bumped dependency version * removed PDFs from repo
- Loading branch information
Showing
11 changed files
with
435 additions
and
464 deletions.
There are no files selected for viewing
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,63 @@ | ||
from pyxdsm.XDSM import (XDSM, OPT, SUBOPT, SOLVER, DOE, | ||
IFUNC, FUNC, GROUP, IGROUP, METAMODEL) | ||
|
||
# styling names for the boxes | ||
opt = 'Optimization' | ||
subopt = 'SubOptimization' | ||
solver = 'MDA' | ||
doe = 'DOE' | ||
ifunc = 'ImplicitFunction' | ||
func = 'Function' | ||
group = 'Group' | ||
igroup = 'ImplicitGroup' | ||
metamodel = 'Metamodel' | ||
from pyxdsm.XDSM import XDSM, OPT, SUBOPT, SOLVER, DOE, IFUNC, FUNC, GROUP, IGROUP, METAMODEL | ||
|
||
x = XDSM() | ||
|
||
x.add_system('opt', opt, r'\text{Optimizer}') | ||
x.add_system('DOE', doe, r'\text{DOE}') | ||
x.add_system('MDA', solver, r'\text{Newton}') | ||
x.add_system('D1', func, 'D_1') | ||
x.add_system("opt", OPT, r"\text{Optimizer}") | ||
x.add_system("DOE", DOE, r"\text{DOE}") | ||
x.add_system("MDA", SOLVER, r"\text{Newton}") | ||
x.add_system("D1", FUNC, "D_1") | ||
|
||
# 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("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') | ||
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}')) | ||
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_system("H", FUNC, "H", stack=True) | ||
|
||
x.add_process(['opt', 'DOE', 'MDA', 'D1', 'D2', 'subopt', 'G1', 'G2', 'MM', 'F', 'H', 'opt'], arrow=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') | ||
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.connect("opt", "H", "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("D1", "opt", r"\mathcal{R}(y_1)") | ||
x.connect("D2", "opt", r"\mathcal{R}(y_2)") | ||
|
||
x.connect('F', 'opt', 'f') | ||
x.connect('H', 'opt', 'h', stack=True) | ||
x.connect("F", "opt", "f") | ||
x.connect("H", "opt", "h", stack=True) | ||
|
||
# can specify inputs to represent external information coming into the XDSM | ||
x.add_input('D1', 'P_1') | ||
x.add_input('D2', 'P_2') | ||
x.add_input('opt', r'x_0', stack=True) | ||
x.add_input("D1", "P_1") | ||
x.add_input("D2", "P_2") | ||
x.add_input("opt", r"x_0", stack=True) | ||
|
||
# can put outputs on the left or right sides | ||
x.add_output('opt', r'x^*, z^*', side='right') | ||
x.add_output('D1', r'y_1^*', side='left') | ||
x.add_output('D2', r'y_2^*', side='left') | ||
x.add_output('F', r'f^*', side='right') | ||
x.add_output('H', r'h^*', side='right') | ||
x.add_output('opt', r'y^*', side='left') | ||
x.add_output("opt", r"x^*, z^*", side="right") | ||
x.add_output("D1", r"y_1^*", side="left") | ||
x.add_output("D2", r"y_2^*", side="left") | ||
x.add_output("F", r"f^*", side="right") | ||
x.add_output("H", r"h^*", side="right") | ||
x.add_output("opt", r"y^*", side="left") | ||
|
||
x.add_process(['output_opt', 'opt', 'left_output_opt']) | ||
x.add_process(["output_opt", "opt", "left_output_opt"]) | ||
|
||
x.write('kitchen_sink', cleanup=False) | ||
x.write_sys_specs('sink_specs') | ||
x.write("kitchen_sink", cleanup=False) | ||
x.write_sys_specs("sink_specs") |
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
Binary file not shown.
Binary file not shown.
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
Oops, something went wrong.