Skip to content
Snippets Groups Projects
Commit 92fbb5ba authored by Michael Alfons Schlüter's avatar Michael Alfons Schlüter
Browse files

Minor updates

parent b59550cd
Branches reproduction
No related tags found
No related merge requests found
Showing
with 35 additions and 4 deletions
......@@ -26,6 +26,7 @@ from scipy import signal
from pathlib import Path
import pyfiglet
import datetime
from time import sleep
def f(question):
"""Answer to the Ultimate Question of Life, the Universe, and Everything.
......@@ -570,12 +571,13 @@ def read_drive_cycle(file, vehicle):
cycle = np.delete(np.asarray(list_of_rows), (0), axis = 0).astype(float)
a = np.zeros((cycle[:,0].shape[0],24))
SVPWM = {}
items = list(range(0,cycle[:,0].shape[0]-1))
#for j in progressBar(items, prefix = 'Drive Cycle calculation:', suffix = 'Complete', length = 50):
items = list(range(0,cycle[:,0].shape[0]))
with click.progressbar(items, label='calculate drive cycle') as bar:
for j in bar:
if j == 0:
a[j,0] = (cycle[j+1,1] - cycle[j,1])/3.6/(cycle[j+1,0] - cycle[j,0]) # acceleration [m/s**2]
a[j,0] = 0 #(cycle[j+1,1] - cycle[j,1])/3.6/(cycle[j+1,0] - cycle[j,0]) # acceleration [m/s**2]
elif j == cycle[:,0].shape[0]-1:
a[j,0] = 0
else:
a[j,0] = (cycle[j+1,1] - cycle[j-1,1])/3.6/(cycle[j+1,0] - cycle[j-1,0]) # acceleration [m/s**2]
a[j,1] = cycle[j,1]/3.6 # speed [m/s]
......
......@@ -24,7 +24,7 @@ plt.rcParams.update({
print(os.listdir('save'))
[cycle, variable_names] = pickle.load( open(os.path.join('save', 'EQS 450+ 800 V_WLTC_Class_3_v53_2022_10_22_14-31.p'),'rb') )
[cycle, variable_names] = pickle.load( open(os.path.join('save', 'EQS 450+ 800 V_WLTC_Class_3_v53_2022_10_27_16-48.p'),'rb') )
cycle[:,25][-1] / (cycle[:,25][-1] + cycle[:,19][-1]) # ETA MOSFET
......@@ -86,6 +86,35 @@ fig.tight_layout()
# plt.savefig('WoWo2.svg')
fig, ax = plt.subplots(figsize=(6,5))
nr = 7
p1 = ax.plot(cycle[0:590,0], cycle[0:590,nr],'tab:blue', label = variable_names[nr])
p2 = ax.plot(cycle[589:1023,0], cycle[589:1023,nr], 'tab:green', label = variable_names[nr])
p3 = ax.plot(cycle[1022:1476,0], cycle[1022:1476,nr], 'tab:orange', label = variable_names[nr])
p4 = ax.plot(cycle[1475:1801,0], cycle[1475:1801,nr], 'tab:red', label = variable_names[nr])
ax.set_ylabel(variable_names[nr])
ax.yaxis.set_label_coords(-.07, .4)
ax.set_xlabel('Time [s]')
ax2 = ax.twinx()
nr = 8
p1 = ax2.plot(cycle[0:590,0], cycle[0:590,nr],'tab:blue', label = variable_names[nr])
p2 = ax2.plot(cycle[589:1023,0], cycle[589:1023,nr], 'tab:green', label = variable_names[nr])
p3 = ax2.plot(cycle[1022:1476,0], cycle[1022:1476,nr], 'tab:orange', label = variable_names[nr])
p4 = ax2.plot(cycle[1475:1801,0], cycle[1475:1801,nr], 'tab:red', label = variable_names[nr])
ax2.set_ylabel(variable_names[nr])
ax2.yaxis.set_label_coords(1.1, 0.85)
# ax2.set_xlabel('Time [s]')
#ax.legend(loc=1)
ax2.set_ylim((-1600,300))
ax.set_ylim((0,170))
ax.set_yticks([0,20,40,60,80,100,120])
ax2.set_yticks([-200,0,200])
ax2.grid(True, axis='y')
ax.grid(True, axis='both', ls="-", color='0.8')
fig.tight_layout()
# plt.savefig('WoWo2.svg')
fig, ax = plt.subplots(figsize=(6,5))
nr = 15 # P_total_MOSFET
p1 = ax.plot(cycle[:,0], cycle[:,nr],'tab:blue', label = variable_names[nr], linewidth=1.0, alpha = 0.6)
......
File added
File added
File deleted
No preview for this file type
File deleted
File deleted
No preview for this file type
File deleted
No preview for this file type
File deleted
No preview for this file type
File deleted
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment