<jupyter_start><jupyter_text>Run POD  Test shape of matrix needed for POD functionnum_vecs = 50;  <-- equivalent to the number of PIV snapshots (Also number of total POD modes)vecs = np.random.random((100, num_vecs))vecs.shape<jupyter_code>uAll = np.concatenate((Uf.reshape(uSize[0]*uSize[1],uSize[2]), Vf.reshape(uSize[0]*uSize[1],uSize[2]), Wf.reshape(uSize[0]*uSize[1],uSize[2])), axis = 0)
uAll.shape      
num_modes = 50;
modes, eig_vals = mr.compute_POD_matrices_snaps_method(uAll, list(range(num_modes)))
menergy = eig_vals/np.sum(eig_vals)
menergy_sum = np.zeros(len(menergy))
for i in range(len(menergy)):
    menergy_sum[i] = np.sum(menergy[:i]);
menergy_sum[-1]<jupyter_output><empty_output><jupyter_text>fig, ax = plt.subplots()ax.bar(range(num_modes),menergy[1:num_modes]*100)<jupyter_code>reload(PODutils)
Umodes, Vmodes, Wmodes = PODutils.reconstructPODmodes(modes,uSize,num_modes,3)
Wmodes.shape
#Calculate the mode coefficients
C = modes.transpose()*uAll
C.shape<jupyter_output><empty_output><jupyter_text>Plot modal energy and contribution total<jupyter_code>ind = np.arange(num_modes)  # the x locations for the groups
width = 1       # the width of the bars

f = plt.figure()
ax = plt.gca()
ax2 = plt.twinx()
rect = ax.bar(ind,menergy[:num_modes], width, color='gray')
line = ax2.plot(ind,menergy_sum[:num_modes],'--r')

ax.set_xlabel("Mode Number",fontsize=14)
ax.set_ylabel("Scaled Mode Energy",fontsize=14)
ax2.set_ylabel("Integrated Energy",fontsize=14,color='red')<jupyter_output><empty_output><jupyter_text>Plot some modes<jupyter_code>reload(PODutils)
PODutils.plotPODmodes3D(X,Y,Umodes,Vmodes,Wmodes,list(range(5)))<jupyter_output><empty_output><jupyter_text>Plot the variation of the coefficients<jupyter_code>reload(PODutils)
PODutils.plotPODcoeff(C,list(range(6)),20)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1487964989059081, 'fraction_numerical': 0.020787746170678335, 'mean_word_length': 8.72872340425532, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '198527', 'license': 'MIT', 'n_tokens_mistral': 770, 'n_tokens_neox': 732, 'n_words': 110, 'path': 'runPOD-BigNeutral.ipynb', 'repo_name': 'Mopolino8/ASIIT', 'size': '1828'}