plot_solutions
Plot solution vectors from MFILEs to compare them.
This tool plots multiple solutions, or their differences, to allow comparisons of the solution vectors and objective function values. It allows normalisation to a given solution as well as plotting RMSEs relative to it.
If the MFILE is the result of a parameter scan, only the last point is plotted currently.
INITIAL_NORM_OPT_PARAM_VALUE_PATTERN = 'xcm'
module-attribute
RANGE_NORM_OPT_PARAM_VALUE_PATTERN = 'nitvar'
module-attribute
OPT_PARAM_VALUE_REGEX = '^itvar\\d{3}$'
module-attribute
NORM_OPT_PARAM_NAME_REGEX = 'itvar\\d{3}_name'
module-attribute
NORM_OBJF_PATTERN = 'objf'
module-attribute
NORM_OBJF_VALUE = 'norm_objf'
module-attribute
NORM_OBJF_NAME = 'objf_name'
module-attribute
TAG_REGEX = 'tag$'
module-attribute
TAG = 'tag'
module-attribute
CON_VALUE_PATTERN = 'eq_con\\d{3}'
module-attribute
CONSTRAINT_NUMS = {'eq_con001': 'EQ: beta, temperature, density', 'eq_con002': 'EQ: global plasma power balance', 'eq_con011': 'EQ: radial build', 'ineq_con030': 'UL: injection power', 'ineq_con015': 'LL: L-H threshold power', 'ineq_con016': 'LL: net electric power', 'ineq_con024': 'UL: beta', 'ineq_con025': 'UL: peak toroidal field', 'ineq_con026': 'UL: CS current density at EOF', 'ineq_con027': 'UL: CS current density at BOP', 'ineq_con033': 'UL: SCTF coil operating J', 'ineq_con034': 'UL: CSTF coil dump voltage', 'ineq_con035': 'UL: SCTF coil winding pack J', 'ineq_con036': 'LL: SCTF coil SC temp margin', 'ineq_con060': 'LL: CS SC temp margin', 'ineq_con062': 'LL: alpha:energy confinement times', 'ineq_con065': 'UL: stress on VV during TF quench', 'ineq_con072': 'UL: CS Tresca yield stress', 'ineq_con081': 'LL: central density > pedestal density', 'ineq_con068': 'UL: divertor protection limit', 'ineq_con031': 'UL: SCTF coil case stress', 'ineq_con032': 'UL: SCTF coil conduit stress', 'ineq_con005': 'UL: density', 'ineq_con008': 'UL: neutron wall load', 'ineq_con009': 'UL: fusion power', 'ineq_con013': 'LL: burn time'}
module-attribute
RunMetadata
dataclass
Metadata for a given Process run.
Define mfile for run and other information to identify it. Depending on what is being run/plotted, different fields can be undefined.
Source code in process/core/io/plot_solutions.py
75 76 77 78 79 80 81 82 83 84 | |
mfile_path
instance-attribute
tag
instance-attribute
plot_mfile_solutions(runs_metadata, plot_title, normalising_tag=None, rmse=False, normalisation_type='init')
Plot multiple solutions, optionally normalised by a given solution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
runs_metadata
|
Sequence[RunMetadata]
|
list of RunMetadata objects |
required |
plot_title
|
str
|
title of plot |
required |
normalising_tag
|
str
|
tag for solution to normalise with. If provided, normalise, otherwise don't, defaults to None |
None
|
rmse
|
bool
|
plot RMS errors relative to reference solution, defaults to False |
False
|
normalisation_type
|
str
|
opt param normalisation to use: one of ["init", "range", None], defaults to "init" |
'init'
|
Returns:
| Type | Description |
|---|---|
Tuple[Figure, DataFrame]
|
figure and dataframe of solutions |
Source code in process/core/io/plot_solutions.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
plot_mfile_solutions_constraints(runs_metadata, title)
Plot constraint values in mfiles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
runs_metadata
|
Sequence[RunMetadata]
|
list of RunMetadata objects |
required |
title
|
str
|
plot title |
required |
Returns:
| Type | Description |
|---|---|
tuple[Figure, DataFrame]
|
figure and dataframe of solutions |
Source code in process/core/io/plot_solutions.py
728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 | |