In [1]:
# Import the needed packages
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from Algorithms import cm2in
from Algorithms import TUBScolorscale
# Plot width and heigth in cm
plot_width = 19.
plot_height = 7.5
# Define data folder
data_folder = "./Data/FOTDS/2/"
# Define the export folder
export_folder = "../Latex/Graphics/Physical_"
In [2]:
# Open the data file
# Column names
temp_range = range(273,314,5)
column_names = ["{:03d}".format(x) for x in temp_range]+['Qdot', 'Inertia Fan', 'Inertia Valve', 'Gascooler', 'Zeta']
# Read the Data from Fan to Temperature
Fan_Temp_K = pd.read_csv(data_folder+'Fan_Temperature_K.csv', sep=' ', header = None, names = column_names)
Fan_Temp_T = pd.read_csv(data_folder+'Fan_Temperature_T.csv', sep=' ', header = None, names = column_names)
Fan_Temp_L = pd.read_csv(data_folder+'Fan_Temperature_L.csv', sep=' ', header = None, names = column_names)
# Sort for Gain -> Temp, Lag -> Temp, Delay -> Temp, Parameter -> All other stuff
dict= {'Gain': Fan_Temp_K[column_names[:-5]],
'Lag':Fan_Temp_T[column_names[:-5]],
'Delay':Fan_Temp_L[column_names[:-5]],
'Parameter': Fan_Temp_K[column_names[-5:]]}
# Concat
Fan_Temp = pd.concat(dict.values(),axis=1,keys=dict.keys())
# Read the Data from Fan to Pressure
Fan_Pressure_K = pd.read_csv(data_folder+'Fan_Pressure_K.csv', sep=' ', header = None, names = column_names)
Fan_Pressure_T = pd.read_csv(data_folder+'Fan_Pressure_T.csv', sep=' ', header = None, names = column_names)
Fan_Pressure_L = pd.read_csv(data_folder+'Fan_Pressure_L.csv', sep=' ', header = None, names = column_names)
# Give the Columns
dict = {'Gain': Fan_Pressure_K[column_names[:-5]],
'Lag':Fan_Pressure_T[column_names[:-5]],
'Delay':Fan_Pressure_L[column_names[:-5]],
'Parameter': Fan_Temp_K[column_names[-5:]]}
# Concat
Fan_Pressure = pd.concat(dict.values(),axis=1,keys=dict.keys())
# Read the Data from Valve to Temperature
Val_Temp_K = pd.read_csv(data_folder+'Valve_Temperature_K.csv', sep=' ', header = None, names = column_names)
Val_Temp_T = pd.read_csv(data_folder+'Valve_Temperature_T.csv', sep=' ', header = None, names = column_names)
Val_Temp_L = pd.read_csv(data_folder+'Valve_Temperature_L.csv', sep=' ', header = None, names = column_names)
# Give the Columns
dict = {'Gain': Val_Temp_K[column_names[:-5]],
'Lag':Val_Temp_T[column_names[:-5]],
'Delay':Val_Temp_L[column_names[:-5]],
'Parameter': Val_Temp_K[column_names[-5:]]}
Valve_Temp = pd.concat(dict.values(),axis=1,keys=dict.keys())
# Read the Data from Valve to Pressure
Val_Pres_K = pd.read_csv(data_folder+'Valve_Pressure_K.csv', sep=' ', header = None, names = column_names)
Val_Pres_T = pd.read_csv(data_folder+'Valve_Pressure_T.csv', sep=' ', header = None, names = column_names)
Val_Pres_L = pd.read_csv(data_folder+'Valve_Pressure_L.csv', sep=' ', header = None, names = column_names)
# Give the Columns
dict = {'Gain': Val_Pres_K[column_names[:-5]],
'Lag':Val_Pres_T[column_names[:-5]],
'Delay':Val_Pres_L[column_names[:-5]],
'Parameter': Val_Pres_K[column_names[-5:]]}
Valve_Pressure = pd.concat(dict.values(),axis=1,keys=dict.keys())
In [23]:
# Diagonal Dominance -> Steady State
# Make a plot
plt.rcParams['svg.fonttype'] = 'none'
plt.style.use('seaborn-whitegrid')
# Make a plot
plt.clf()
fig, ax = plt.subplots(1, figsize=cm2in(plot_width, plot_height))
# Data Sorting for Parameter Values
length = Fan_Temp.shape[0]
print(length)
dom_max = []
dom_min = []
det_max = []
det_min = []
x = []
# Preallocation
for scenario in range(0,length):
x = []
main = []
minor = []
delta = []
for temps in temp_range:
# Minimum of the main diagonal
main.append(np.min(np.abs(np.array([Fan_Temp['Gain', str(temps)][scenario],Valve_Pressure['Gain', str(temps)][scenario]]))))
# Maximum of the splitter and minor Diagonal
s = (Fan_Pressure['Gain', str(temps)][scenario])*(Valve_Temp['Gain', str(temps)][scenario])
s1 = s / Valve_Pressure['Gain', str(temps)][scenario]
s2 = s / Fan_Temp['Gain', str(temps)][scenario]
minor.append(np.max(np.abs(np.array([s1,s2]))))
delta.append(np.max(np.abs(np.array([s1,s2])))/np.abs(np.min(np.array([Fan_Temp['Gain', str(temps)][scenario],Valve_Pressure['Gain', str(temps)][scenario]]))))
# Append the temperature
x.append(temps)
# Plot the value
if scenario == 8:
ax.plot(x, delta, color = TUBScolorscale[1])
#ax.plot(x, main, color = TUBScolorscale[1])
#ax.plot(x,minor,color=TUBScolorscale[1], linestyle = "dashed")
else:
ax.plot(x, delta, color = 'grey', alpha = 0.1)
#ax.plot(x, main, color = 'grey', alpha = 0.3)
#ax.plot(x,minor,color='grey', alpha = 0.3, linestyle = "dashed")
plt.grid(True)
plt.xticks(temp_range)
plt.xlabel('T_{amb} [K]')
plt.ylabel('\Delta_D')
plt.savefig(export_folder+'ErrorSteadyState.svg')
plt.show()
In [27]:
# Diagonal Dominance -> Steady State
# Make a plot
plt.rcParams['svg.fonttype'] = 'none'
plt.style.use('seaborn-whitegrid')
# Make a plot
plt.clf()
fig, ax = plt.subplots(1, figsize=cm2in(plot_width, 1.5*plot_height))
# Data Sorting for Parameter Values
length = Fan_Temp.shape[0]
# Preallocation
for scenario in range(0,length):
x = []
dom1, dom2 = [], []
for temps in temp_range:
# Minor Diagonal
#main = (Fan_Temp['Lag', str(temps)][scenario]+Fan_Temp['Delay', str(temps)][scenario])*(Valve_Pressure['Lag', str(temps)][scenario]+Valve_Pressure['Delay', str(temps)][scenario])
main = (Fan_Temp['Gain', str(temps)][scenario])*(Valve_Pressure['Gain', str(temps)][scenario])
#minor = (Fan_Pressure['Lag', str(temps)][scenario]+Fan_Pressure['Delay', str(temps)][scenario])*(Valve_Temp['Lag', str(temps)][scenario]+Valve_Temp['Delay', str(temps)][scenario])
minor = (Fan_Pressure['Gain', str(temps)][scenario])*(Valve_Temp['Gain', str(temps)][scenario])
dom1.append(np.abs((minor)/main))
dom2.append(np.abs((minor/main)**2))
x.append(temps)
if scenario == 8:
ax.plot(x,dom1, color = TUBScolorscale[1])
ax.plot(x,np.array(dom2),color = TUBScolorscale[1], linestyle = "dashed")
else:
ax.plot(x,dom1, color = 'grey', alpha = 0.1)
ax.plot(x,np.array(dom2), color = 'grey', alpha = 0.1, linestyle = "dashed")
plt.grid(True)
plt.xticks(temp_range)
plt.xlabel('T_{amb} [K]')
plt.ylabel('\det(\ma{E})')
plt.savefig(export_folder+'Dominance_SteadyState.svg')
plt.show()
In [4]:
plt.clf()
fig, ax = plt.subplots(1)
for i in range(0,len(TUBScolorscale)):
ax.scatter(i,i, color=TUBScolorscale[i])
plt.show()
In [18]:
# Diagonal Dominance -> Steady State
# Make a plot
plt.rcParams['svg.fonttype'] = 'none'
plt.style.use('seaborn-whitegrid')
# Make a plot
plt.clf()
fig, ax = plt.subplots(5, figsize=cm2in(plot_width,plot_width), sharex = True)
# Data Sorting for Parameter Values
length = Fan_Temp.shape[0]
# Preallocation
for scenario in range(0,length):
x = []
#'Qdot', 'Inertia Fan', 'Inertia Valve', 'Gascooler', 'Zeta'
q, tf, tv, gc,z = [],[],[],[],[]
for temps in temp_range:
# Minor Diagonal
#main = (Fan_Temp['Lag', str(temps)][scenario]+Fan_Temp['Delay', str(temps)][scenario])*(Valve_Pressure['Lag', str(temps)][scenario]+Valve_Pressure['Delay', str(temps)][scenario])
q.append(Valve_Pressure['Parameter','Qdot'][scenario])
tf.append(Valve_Pressure['Parameter','Inertia Fan'][scenario])
tv.append(Valve_Pressure['Parameter','Inertia Valve'][scenario])
gc.append(Valve_Pressure['Parameter','Gascooler'][scenario])
z.append(Valve_Pressure['Parameter','Zeta'][scenario])
x.append(scenario+1)
ax[0].scatter(x,q,color = TUBScolorscale[scenario])
ax[1].scatter(x,tf,color = TUBScolorscale[scenario])
ax[2].scatter(x,tv,color = TUBScolorscale[scenario])
ax[3].scatter(x,gc,color = TUBScolorscale[scenario])
ax[4].scatter(x,z,color = TUBScolorscale[scenario])
plt.grid(True)
ax[0].set_title('Scenario Coding and Parameter')
ax[0].set_ylabel('Cooling Capacity')
ax[1].set_ylabel('Lag Fan')
ax[2].set_ylabel('Lag Valve')
ax[3].set_ylabel('Parallel Tubes')
ax[4].set_ylabel('Zeta')
ax[4].set_xlabel('Scenario No.')
plt.xticks(np.arange(1, length+1, 1.0))
#plt.legend(loc="lower right", ncol=1, bbox_to_anchor=(1.4,0.1))
plt.show()
In [45]:
# Diagonal Dominance -> Steady State
# Make a plot
plt.rcParams['svg.fonttype'] = 'none'
plt.style.use('seaborn-whitegrid')
# Make a plot
plt.clf()
fig, ax = plt.subplots(2,2, figsize=cm2in(plot_width,plot_width), sharex = True, sharey = True)
# Data Sorting for Parameter Values
length = Fan_Temp.shape[0]
# Preallocation
max_k1,max_k2,max_k3,max_k4 = [],[],[],[]
min_k1,min_k2,min_k3,min_k4 = [],[],[],[]
for scenario in range(0,length):
x = []
ft, vp, fp, vt = [],[],[],[]
for temps in temp_range:
# Minor Diagonal
#main = (Fan_Temp['Lag', str(temps)][scenario]+Fan_Temp['Delay', str(temps)][scenario])*(Valve_Pressure['Lag', str(temps)][scenario]+Valve_Pressure['Delay', str(temps)][scenario])
ft.append(Fan_Temp['Gain', str(temps)][scenario])
vp.append(Valve_Pressure['Gain', str(temps)][scenario])
fp.append( Fan_Pressure['Gain', str(temps)][scenario])
vt.append(Valve_Temp['Gain', str(temps)][scenario])
x.append(temps)
if scenario == 8:
ax[0,0].plot(x,ft,color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
ax[0,1].plot(x,vt, color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
ax[1,0].plot(x,fp, color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
ax[1,1].plot(x,vp, color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
else:
ax[0,0].plot(x,ft,color = 'grey', alpha = 0.1, label = 'Scenario '+str(scenario))
ax[0,1].plot(x,vt,color = 'grey', alpha = 0.1,label = 'Scenario '+str(scenario))
ax[1,0].plot(x,fp,color = 'grey', alpha = 0.1, label = 'Scenario '+str(scenario))
ax[1,1].plot(x,vp,color = 'grey', alpha = 0.1, label = 'Scenario '+str(scenario))
plt.grid(True)
ax[1,0].set_xlabel('T_{amb} [K]')
ax[1,1].set_xlabel('T_{amb} [K]')
ax[0,0].set_ylabel('K_{11} [ K~s ]')
ax[0,1].set_ylabel('K_{12} [ \\frac{K}{m^2}]')
ax[1,0].set_ylabel('K_{21} [ bar~s ]')
ax[1,1].set_ylabel('K_{22} [ \\frac{bar}{m^2} ]')
#plt.legend(loc="lower right", ncol=1, bbox_to_anchor=(1.6,0.4))
plt.savefig("../Latex/Graphics/Gain_Change.svg")
plt.show()
In [5]:
# Diagonal Dominance -> Steady State
# Make a plot
plt.rcParams['svg.fonttype'] = 'none'
plt.style.use('seaborn-whitegrid')
# Make a plot
plt.clf()
fig, ax = plt.subplots(3,4, figsize=cm2in(20,3*plot_height), sharex = True, sharey = False)
# Data Sorting for Parameter Values
length = Fan_Temp.shape[0]
# Preallocation
max_k1,max_k2,max_k3,max_k4 = [],[],[],[]
min_k1,min_k2,min_k3,min_k4 = [],[],[],[]
for scenario in range(0,length):
x = []
ft, vp, fp, vt = [],[],[],[]
for temps in temp_range:
# Minor Diagonal
#main = (Fan_Temp['Lag', str(temps)][scenario]+Fan_Temp['Delay', str(temps)][scenario])*(Valve_Pressure['Lag', str(temps)][scenario]+Valve_Pressure['Delay', str(temps)][scenario])
ft.append(Fan_Temp['Gain', str(temps)][scenario])
vp.append(Valve_Pressure['Gain', str(temps)][scenario])
fp.append( Fan_Pressure['Gain', str(temps)][scenario])
vt.append(Valve_Temp['Gain', str(temps)][scenario])
x.append(temps)
if scenario == 8:
ax[0,0].plot(x,ft,color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
ax[0,1].plot(x,vt, color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
ax[0,2].plot(x,fp, color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
ax[0,3].plot(x,vp, color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
else:
ax[0,0].plot(x,ft,color = 'grey', alpha = 0.1, label = 'Scenario '+str(scenario))
ax[0,1].plot(x,vt,color = 'grey', alpha = 0.1,label = 'Scenario '+str(scenario))
ax[0,2].plot(x,fp,color = 'grey', alpha = 0.1, label = 'Scenario '+str(scenario))
ax[0,3].plot(x,vp,color = 'grey', alpha = 0.1, label = 'Scenario '+str(scenario))
# Lag
x = []
ft, vp, fp, vt = [],[],[],[]
for temps in temp_range:
# Minor Diagonal
#main = (Fan_Temp['Lag', str(temps)][scenario]+Fan_Temp['Delay', str(temps)][scenario])*(Valve_Pressure['Lag', str(temps)][scenario]+Valve_Pressure['Delay', str(temps)][scenario])
ft.append(Fan_Temp['Lag', str(temps)][scenario])
vp.append(Valve_Pressure['Lag', str(temps)][scenario])
fp.append( Fan_Pressure['Lag', str(temps)][scenario])
vt.append(Valve_Temp['Lag', str(temps)][scenario])
x.append(temps)
if scenario == 8:
ax[1,0].plot(x,ft,color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
ax[1,1].plot(x,vt, color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
ax[1,2].plot(x,fp, color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
ax[1,3].plot(x,vp, color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
else:
ax[1,0].plot(x,ft,color = 'grey', alpha = 0.1, label = 'Scenario '+str(scenario))
ax[1,1].plot(x,vt,color = 'grey', alpha = 0.1,label = 'Scenario '+str(scenario))
ax[1,2].plot(x,fp,color = 'grey', alpha = 0.1, label = 'Scenario '+str(scenario))
ax[1,3].plot(x,vp,color = 'grey', alpha = 0.1, label = 'Scenario '+str(scenario))
# Delay
x = []
ft, vp, fp, vt = [],[],[],[]
for temps in temp_range:
# Minor Diagonal
#main = (Fan_Temp['Lag', str(temps)][scenario]+Fan_Temp['Delay', str(temps)][scenario])*(Valve_Pressure['Lag', str(temps)][scenario]+Valve_Pressure['Delay', str(temps)][scenario])
ft.append(Fan_Temp['Delay', str(temps)][scenario])
vp.append(Valve_Pressure['Delay', str(temps)][scenario])
fp.append( Fan_Pressure['Delay', str(temps)][scenario])
vt.append(Valve_Temp['Delay', str(temps)][scenario])
x.append(temps)
if scenario == 8:
ax[2,0].plot(x,ft,color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
ax[2,1].plot(x,vt, color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
ax[2,2].plot(x,fp, color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
ax[2,3].plot(x,vp, color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
else:
ax[2,0].plot(x,ft,color = 'grey', alpha = 0.1, label = 'Scenario '+str(scenario))
ax[2,1].plot(x,vt,color = 'grey', alpha = 0.1,label = 'Scenario '+str(scenario))
ax[2,2].plot(x,fp,color = 'grey', alpha = 0.1, label = 'Scenario '+str(scenario))
ax[2,3].plot(x,vp,color = 'grey', alpha = 0.1, label = 'Scenario '+str(scenario))
plt.grid(True)
# Set the labels
ax[2,0].set_xlabel('T_{amb} [K]')
ax[2,1].set_xlabel('T_{amb} [K]')
ax[2,2].set_xlabel('T_{amb} [K]')
ax[2,3].set_xlabel('T_{amb} [K]')
# Gain
ax[0,0].set_title('K_{11} ')
ax[0,1].set_title('K_{12} ')
ax[0,2].set_title('K_{21}')
ax[0,3].set_title('K_{22}')
# Lag
ax[1,0].set_title('T_{11}')
ax[1,1].set_title('T_{12}')
ax[1,2].set_title('T_{21}')
ax[1,3].set_title('T_{22}')
# Delay
ax[2,0].set_title('L_{11}')
ax[2,1].set_title('L_{12}')
ax[2,2].set_title('L_{21}')
ax[2,3].set_title('L_{22}')
#plt.legend(loc="lower right", ncol=1, bbox_to_anchor=(1.6,0.4))
plt.savefig("../Latex/Graphics/FOTD_Change.svg")
plt.show()
In [46]:
# Diagonal Dominance -> Steady State
# Make a plot
plt.rcParams['svg.fonttype'] = 'none'
plt.style.use('seaborn-whitegrid')
# Make a plot
plt.clf()
fig, ax = plt.subplots(2,2, figsize=cm2in(plot_width,plot_width), sharex = True, sharey = True)
# Data Sorting for Parameter Values
length = Fan_Temp.shape[0]
# Preallocation
max_k1,max_k2,max_k3,max_k4 = [],[],[],[]
min_k1,min_k2,min_k3,min_k4 = [],[],[],[]
for scenario in range(0,length):
x = []
ft, vp, fp, vt = [],[],[],[]
for temps in temp_range:
# Minor Diagonal
#main = (Fan_Temp['Lag', str(temps)][scenario]+Fan_Temp['Delay', str(temps)][scenario])*(Valve_Pressure['Lag', str(temps)][scenario]+Valve_Pressure['Delay', str(temps)][scenario])
ft.append(Fan_Temp['Lag', str(temps)][scenario])
vp.append(Valve_Pressure['Lag', str(temps)][scenario])
fp.append( Fan_Pressure['Lag', str(temps)][scenario])
vt.append(Valve_Temp['Lag', str(temps)][scenario])
x.append(temps)
if scenario == 8:
ax[0,0].plot(x,ft,color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
ax[0,1].plot(x,vt, color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
ax[1,0].plot(x,fp, color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
ax[1,1].plot(x,vp, color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
else:
ax[0,0].plot(x,ft,color = 'grey', alpha = 0.1, label = 'Scenario '+str(scenario))
ax[0,1].plot(x,vt,color = 'grey', alpha = 0.1,label = 'Scenario '+str(scenario))
ax[1,0].plot(x,fp,color = 'grey', alpha = 0.1, label = 'Scenario '+str(scenario))
ax[1,1].plot(x,vp,color = 'grey', alpha = 0.1, label = 'Scenario '+str(scenario))
plt.grid(True)
ax[1,0].set_xlabel('T_{amb} [K]')
ax[1,1].set_xlabel('T_{amb} [K]')
ax[0,0].set_ylabel('T_{11} [s ]')
ax[0,1].set_ylabel('T_{12} [s]')
ax[1,0].set_ylabel('T_{21} [s]')
ax[1,1].set_ylabel('T_{22} [s]')
#plt.legend(loc="lower right", ncol=1, bbox_to_anchor=(1.6,0.4))
plt.savefig("../Latex/Graphics/Lag_Change.svg")
plt.show()
In [47]:
# Diagonal Dominance -> Steady State
# Make a plot
plt.rcParams['svg.fonttype'] = 'none'
plt.style.use('seaborn-whitegrid')
# Make a plot
plt.clf()
fig, ax = plt.subplots(2,2, figsize=cm2in(plot_width,plot_width), sharex = True, sharey = True)
# Data Sorting for Parameter Values
length = Fan_Temp.shape[0]
# Preallocation
max_k1,max_k2,max_k3,max_k4 = [],[],[],[]
min_k1,min_k2,min_k3,min_k4 = [],[],[],[]
for scenario in range(0,length):
x = []
ft, vp, fp, vt = [],[],[],[]
for temps in temp_range:
# Minor Diagonal
#main = (Fan_Temp['Lag', str(temps)][scenario]+Fan_Temp['Delay', str(temps)][scenario])*(Valve_Pressure['Lag', str(temps)][scenario]+Valve_Pressure['Delay', str(temps)][scenario])
ft.append(Fan_Temp['Delay', str(temps)][scenario])
vp.append(Valve_Pressure['Delay', str(temps)][scenario])
fp.append( Fan_Pressure['Delay', str(temps)][scenario])
vt.append(Valve_Temp['Delay', str(temps)][scenario])
x.append(temps)
if scenario == 8:
ax[0,0].plot(x,ft,color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
ax[0,1].plot(x,vt, color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
ax[1,0].plot(x,fp, color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
ax[1,1].plot(x,vp, color = TUBScolorscale[1], label = 'Scenario '+str(scenario))
else:
ax[0,0].plot(x,ft,color = 'grey', alpha = 0.1, label = 'Scenario '+str(scenario))
ax[0,1].plot(x,vt,color = 'grey', alpha = 0.1,label = 'Scenario '+str(scenario))
ax[1,0].plot(x,fp,color = 'grey', alpha = 0.1, label = 'Scenario '+str(scenario))
ax[1,1].plot(x,vp,color = 'grey', alpha = 0.1, label = 'Scenario '+str(scenario))
plt.grid(True)
ax[1,0].set_xlabel('T_{amb} [K]')
ax[1,1].set_xlabel('T_{amb} [K]')
ax[0,0].set_ylabel('L_{11} [s ]')
ax[0,1].set_ylabel('L_{12} [s]')
ax[1,0].set_ylabel('L_{21} [s]')
ax[1,1].set_ylabel('L_{22} [s]')
#plt.legend(loc="lower right", ncol=1, bbox_to_anchor=(1.6,0.4))
plt.savefig("../Latex/Graphics/Delay_Change.svg")
plt.show()
In [10]:
# Diagonal Dominance -> Steady State
# Make a plot
plt.rcParams['svg.fonttype'] = 'none'
plt.style.use('seaborn-whitegrid')
# Make a plot
plt.clf()
fig, ax = plt.subplots(2,2, figsize=cm2in(plot_width,plot_width), sharex = True, sharey = True)
# Data Sorting for Parameter Values
length = Fan_Temp.shape[0]
# Preallocation
for scenario in range(0,length):
x = []
ft, vp, fp, vt = [],[],[],[]
for temps in temp_range:
# Minor Diagonal
#main = (Fan_Temp['Lag', str(temps)][scenario]+Fan_Temp['Delay', str(temps)][scenario])*(Valve_Pressure['Lag', str(temps)][scenario]+Valve_Pressure['Delay', str(temps)][scenario])
ft.append(Fan_Temp['Lag', str(temps)][scenario])
vp.append(Valve_Pressure['Lag', str(temps)][scenario])
fp.append( Fan_Pressure['Lag', str(temps)][scenario])
vt.append(Valve_Temp['Lag', str(temps)][scenario])
x.append(temps)
ax[0,0].plot(x,ft, color = TUBScolorscale[scenario], label = 'Scenario '+str(scenario))
ax[0,1].plot(x,vt, color = TUBScolorscale[scenario], label = 'Scenario '+str(scenario))
ax[1,0].plot(x,fp, color = TUBScolorscale[scenario], label = 'Scenario '+str(scenario))
ax[1,1].plot(x,vp, color = TUBScolorscale[scenario], label = 'Scenario '+str(scenario))
plt.grid(True)
ax[1,0].set_xlabel('Temperature [K]')
ax[1,1].set_xlabel('Temperature [K]')
ax[1,0].set_ylabel('Temperature [K]')
ax[0,0].set_ylabel('Pressure [bar]')
plt.legend(loc="lower right", ncol=1, bbox_to_anchor=(1.6,0.4))
plt.show()
In [12]:
# Diagonal Dominance -> Steady State
# Make a plot
plt.rcParams['svg.fonttype'] = 'none'
plt.style.use('seaborn-whitegrid')
# Make a plot
plt.clf()
fig, ax = plt.subplots(2,2, figsize=cm2in(plot_width,plot_width), sharex = True, sharey = True)
# Data Sorting for Parameter Values
length = Fan_Temp.shape[0]
# Preallocation
for scenario in range(0,length):
x = []
ft, vp, fp, vt = [],[],[],[]
for temps in temp_range:
# Minor Diagonal
#main = (Fan_Temp['Lag', str(temps)][scenario]+Fan_Temp['Delay', str(temps)][scenario])*(Valve_Pressure['Lag', str(temps)][scenario]+Valve_Pressure['Delay', str(temps)][scenario])
ft.append(Fan_Temp['Delay', str(temps)][scenario])
vp.append(Valve_Pressure['Delay', str(temps)][scenario])
fp.append( Fan_Pressure['Delay', str(temps)][scenario])
vt.append(Valve_Temp['Delay', str(temps)][scenario])
x.append(temps)
ax[0,0].plot(x,ft, color = TUBScolorscale[scenario], label = 'Scenario '+str(scenario))
ax[0,1].plot(x,vt, color = TUBScolorscale[scenario], label = 'Scenario '+str(scenario))
ax[1,0].plot(x,fp, color = TUBScolorscale[scenario], label = 'Scenario '+str(scenario))
ax[1,1].plot(x,vp, color = TUBScolorscale[scenario], label = 'Scenario '+str(scenario))
plt.grid(True)
ax[1,0].set_xlabel('Temperature [K]')
ax[1,1].set_xlabel('Temperature [K]')
ax[1,0].set_ylabel('Temperature [K]')
ax[0,0].set_ylabel('Pressure [bar]')
plt.legend(loc="lower right", ncol=1, bbox_to_anchor=(1.6,0.4))
plt.show()
In [ ]:
# Diagonal Dominance -> Steady State
# Make a plot
plt.rcParams['svg.fonttype'] = 'none'
plt.style.use('seaborn-whitegrid')
# Make a plot
plt.clf()
fig, ax = plt.subplots(2,2, figsize=cm2in(plot_width,plot_width), sharex = True, sharey = True)
# Data Sorting for Parameter Values
length = Fan_Temp.shape[0]
# Preallocation
for scenario in range(0,length):
x = []
ft, vp, fp, vt = [],[],[],[]
for temps in temp_range:
# Minor Diagonal
#main = (Fan_Temp['Lag', str(temps)][scenario]+Fan_Temp['Delay', str(temps)][scenario])*(Valve_Pressure['Lag', str(temps)][scenario]+Valve_Pressure['Delay', str(temps)][scenario])
ft.append(Fan_Temp['Delay', str(temps)][scenario])
vp.append(Valve_Pressure['Delay', str(temps)][scenario])
fp.append( Fan_Pressure['Delay', str(temps)][scenario])
vt.append(Valve_Temp['Delay', str(temps)][scenario])
x.append(temps)
ax[0,0].plot(x,ft)
ax[0,1].plot(x,vt)
ax[1,0].plot(x,fp)
ax[1,1].plot(x,vp)
plt.grid(True)
ax[1,0].set_xlabel('Temperature [K]')
ax[1,1].set_xlabel('Temperature [K]')
ax[1,0].set_ylabel('Temperature [K]')
ax[0,0].set_ylabel('Pressure [bar]')
plt.legend(loc="lower right", ncol=1, bbox_to_anchor=(1.4,0.1))
plt.show()
In [52]:
# Gain 3d Plot
# Make a plot
plt.rcParams['svg.fonttype'] = 'none'
plt.style.use('seaborn-whitegrid')
from mpl_toolkits.mplot3d import Axes3D
# Make a plot
plt.clf()
fig = plt.figure(figsize=cm2in(plot_width,plot_width), )
ax = fig.add_subplot(111,projection = '3d')
# Data Sorting for Parameter Values
length = Fan_Temp.shape[0]
# Preallocation
for scenario in range(0,length):
x,y,z = [],[],[]
# Calculate the mean for gain
gain = []
for temps in temp_range:
# Minor Diagonal
#main = (Fan_Temp['Lag', str(temps)][scenario]+Fan_Temp['Delay', str(temps)][scenario])*(Valve_Pressure['Lag', str(temps)][scenario]+Valve_Pressure['Delay', str(temps)][scenario])
gain.append(Fan_Temp['Gain', str(temps)][scenario])
#vp.append(Valve_Pressure['Delay', str(temps)][scenario])
#fp.append( Fan_Pressure['Delay', str(temps)][scenario])
#vt.append(Valve_Temp['Delay', str(temps)][scenario])
x = Fan_Temp['Parameter','Inertia Valve'][scenario]
y = Fan_Temp['Parameter','Gascooler'][scenario]
z = Fan_Temp['Parameter','Zeta'][scenario]
ax.plot(x,y,z,s = 50*np.abs(np.mean(gain)), color = TUBScolorscale[scenario])
#ax.scatter(0,y,z, s = 50, color = TUBScolorscale[scenario],marker ='+')
#ax.scatter(x,80,z, s = 50, color = TUBScolorscale[scenario],marker ='+')
#ax.scatter(x,y,0, s = 50, color = TUBScolorscale[scenario],marker ='+')
ax.scatter(x,y,z, s = 50*(np.abs(np.mean(gain))+np.abs(np.var(gain))),alpha = 0.3, color = TUBScolorscale[scenario])
plt.grid(True)
plt.show()
In [72]:
from pandas.tools.plotting import parallel_coordinates
#data = pandas.read_csv(r'C:\Python27\Lib\site-packages\pandas\tests\data\iris.csv', sep=',')
Fan_Pressure['Gain'].columns
pd.tools.plotting.parallel_coordinates(
Fan_Pressure['Gain'],
Fan_Pressure['Gain'].columns)
plt.show()
In [ ]: