# Import of packages: import numpy as np import matplotlib.pyplot as plt # Model param: L = 4 # [m] D = 5 # [m] x_lb = 0 # [deg] x_ub = 90 # [deg] N_x = 100 x_array = np.linspace(x_lb, x_ub, N_x) x_rad_array = x_array*np.pi/180 V_array = (D*L**2*np.cos(x_rad_array) *np.sin(x_rad_array)) # Plotting objective function f for a number of x: plt.close('all') # Closes all figures before plotting plt.figure(num=1, figsize=(24/2.54, 18/2.54)) # Inches plt.plot(x_array, V_array, '.', label='V [m^3]') plt.legend() plt.xlabel('x [deg]') plt.grid(which='both', color='grey') # plt.savefig('prog_plott_hytte_volum.pdf') plt.show()