-
Notifications
You must be signed in to change notification settings - Fork 40
/
docstringparsing_output.txt
85 lines (75 loc) · 2.51 KB
/
docstringparsing_output.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
from gpkit import Variable, VectorVariable # Demonstration of nomenclature syntax
#
# Lines that end in "Variables" will be parsed as a scalar variable table
# until the next blank line.
#
# Variables
# ---------
A = self.A = Variable('A', 'm^2', 'surface area') # from 'A [m^2] surface area'
V = self.V = Variable('V', 100, 'L', 'minimum volume') # from 'V 100 [L] minimum volume'
#
# Lines that end in "Variables of length $N" will be parsed as vector
# variables of length $N until the next blank line.
#
# Variables of length 3
# ---------------------
s = self.s = VectorVariable(3, 's', 'm', 'side length') # from 's [m] side length'
#
# Let's introduce more variables: (any line ending in "Variables" is parsed)
#
# Zoning Variables
# ----------------
h = self.h = Variable('h', 1, 'm', 'minimum height') # from 'h 1 [m] minimum height'
#
# Upper Unbounded
# ---------------
# A
#
# The ordering of these blocks doesn't affect anything; order them in the
# way that makes the most sense to someone else reading your model.
#
┃┓ ┓ /┓
┃┃ ┃ ┃
┃┃ ┣╸s[0] /┣╸h
Cost╺┫┃ ┃ (0.316m) ┃ (1m, fixed)
(1.46m²) ┃┣╸A ┛ /┛
┃┃ (1.46m²) ┓ ┓
┃┃ ┣╸s[2] ┣╸h
┃┛ ┛ (1m) ┛
┃┓ ┓
┃┃ ┃
┃┃ ┃
┃┃ ┃
┃┃ ┣╸A ≥ 2·(s[0]·s[1] + s[1]·s[2] + s[2]·s[0])
┃┃ ┃
┃┃ ┃
┃┃ ┛
┃┃ ┓
Model╺┫┃ ┃
┃┣╸Cube ┣╸V = 100l
┃┃ ┛
┃┃ ┓
┃┃ ┃
┃┃ ┣╸V ≤ s[:].prod()
┃┃ ┛
┃┃ ┣╸h = 1m
┃┃ ┛
┃┃ ┣╸s[2] ≥ h
┃┛ ┛
Free Variables
--------------
A : 1.465 [m²] surface area
s : [ 0.316 0.316 1 ] [m] side length
Fixed Variables
---------------
V : 100 [l] minimum volume
h : 1 [m] minimum height
Variable Sensitivities
----------------------
V : +0.57 minimum volume
h : +0.3 minimum height
Most Sensitive Constraints
--------------------------
+1 : A ≥ 2·(s[0]·s[1] + s[1]·s[2] + s[2]·s[0])
+0.57 : V ≤ s[:].prod()
+0.3 : s[2] ≥ h