Exemple #1
0
print('Routine Complete')

# ROM
rom = ROM.KrylovReducedOrderModel()
rom.initialise(data=None, ss=system_DT)

algorithm = 'dual_rational_arnoldi'
# algorithm = 'arnoldi'
r = 1
# frequency = np.array([1.0, 1.005j])
# frequency = np.array([np.inf])
frequency = np.array([0.7j, 1.0j])
z_interpolation = np.exp(frequency * dt)

rom.run(algorithm, r, frequency=z_interpolation)

plot_freq = freq_plots.FrequencyResponseComparison()
plot_settings = {'frequency_type': 'w', 'plot_type': 'bode'}

plot_freq.initialise(None, system_DT, rom, plot_settings)
if system_type == 'MIMO':
    plot_freq.plot_frequency_response(wv, freqresp[:3, :3, :],
                                      rom.ssrom.freqresp(wv)[:3, :3, :],
                                      frequency)
else:
    plot_freq.plot_frequency_response(wv, freqresp, rom.ssrom.freqresp(wv),
                                      frequency)

# plot_freq.plot_frequency_response(wv, freqresp[4:, 4:, :], rom.ssrom.freqresp(wv), frequency)
plot_freq.savefig('DT_07_1_r2.pdf')
Exemple #2
0
        shutil.rmtree(save_dir)
        os.mkdir(save_dir)
    else:
        raise FileExistsError
np.save(save_dir + '/Y_rom', frequency_response_rom)
# np.save(save_dir + '/Y_fom', frequency_response_fom)
np.save(save_dir + '/kv', kv)
np.save(save_dir + '/interp', interpolation_point)
np.save(save_dir + '/r', r)
np.save(save_dir + '/A_uvlm', rom.ssrom.A)
np.save(save_dir + '/B_uvlm', rom.ssrom.B)
np.save(save_dir + '/C_uvlm', rom.ssrom.C)
np.save(save_dir + '/D_uvlm', rom.ss.D)


fplot = freq_resp.FrequencyResponseComparison()
fsettings = {'frequency_type': 'k',
             'plot_type': 'real_and_imaginary_mimo'}
fplot.initialise(data, aeroelastic_system.linuvlm.SS, rom, fsettings)
i = 0
o = 0
in_range = 2*i
in_rangef = in_range + 2
out_range = 2*0
out_rangef = out_range+2
#fplot.plot_frequency_response(kv, frequency_response_fom[out_range:out_rangef, in_range:in_rangef, :],
#                              frequency_response_rom[out_range:out_rangef, in_range:in_rangef, :], interpolation_point)
#fplot.savefig(fig_folder + '/ROM_Freq_response_' + case_name + case_nlin_info + case_rom_info + '.pdf')

# Modal UVLM eigenvalues
eigs_UVLM = sclalg.eigvals(rom.ssrom.A)
Exemple #3
0
ax[1, 1].set_xlabel('Reduced Frequency, k')

fig.savefig('./figs/theo_rolled/Err_MIMO_0_r4.eps')
Y_freq_rom = rom.ssrom.freqresp(wv)
#
# fig.show()
#
# # if frequency_rom is None:  # for plotting purposes
# #     k_rom = np.inf
# # else:
# #     k_rom = ws.c_ref * frequency_rom.real * 0.5 / Uinf0
# #
# #
# # # rom.compare_frequency_response(wv, plot_figures=False)
# #
frequency_response_plot = freqplot.FrequencyResponseComparison()
# #
plot_settings = {'frequency_type': 'k', 'plot_type': 'real_and_imaginary'}
# # #
frequency_response_plot.initialise(data0, SStot, rom, plot_settings)
frequency_response_plot.plot_frequency_response(kv, Yfreq_dummy_all,
                                                Y_freq_rom,
                                                frequency_continuous_k)
frequency_response_plot.save_figure('./figs/theo_rolled/MIMO_0_r4.pdf')
# Y_freq_rom = rom.ssrom.freqresp(wv)

# Plotting

# # Error estimation
# H_infty_error_norm = np.max(np.sqrt((Yfreq_dummy_all[0,0,:]-Y_freq_rom[0,0,:])*
#                                           np.conj(Yfreq_dummy_all[0,0,:]-Y_freq_rom[0,0,:])))