Проблема с граничным значением – множественный аргумент ⇐ Python
-
Anonymous
Проблема с граничным значением – множественный аргумент
I am developing a model for the 1-D geometry product which is exposed to different conditions on the top and bottom surface as you can see in the code. Unfortunately, for the boundary condition, it is always giving error as bc takes multiple argument which should take single argument.
import numpy as np from scipy.integrate import solve_bvp # Constants Ly = 0.0015 # Total thickness of the system (meters) T = 40 # Total simulation time (seconds) Ny = 51 # Number of spatial grid points Nt = 50000 # Number of time steps velocity_x = 0.2 # line speed in m/s # Thermal properties of different layers layer1_thickness = 0.001 # Thickness of layer 1 (meters) layer1_k = 0.15 # Thermal conductivity of layer 1 (W/m-K) layer2_thickness = 0.5e-3 # Thickness of layer 2 (meters) layer2_k = 0.16 # Thermal conductivity of layer 2 (W/m-K) rho_1 = 1250 # density of layer 1 (kg/m³) rho_2 = 1520 # density of layer 2 (kg/m³) cp_1 = 1350 # specific heat capacity of layer 1 (J/kg-K) cp_2 = 1460 # specific heat capacity of layer 2 (J/kg-K) T_roller = 150 # Temperature of hot roller (°C) h_roller = 500 # Convective heat transfer coefficient (W/m2-K) T_cooling_roller = 22 # Temperature of cooling temperature(°C) # Ambient temperature and convection properties T_ambient = 25 # Ambient temperature (°C) h_air = 12 # Convective heat transfer coefficient of air (W/m²-K) radiation_length = 1.280 # radiation length in m radiation_width = 2.300 # radiation width in m radiation_power = 138e3 # W radiative_flux = 50e3 # W/m2 absorption = 45 # in % performance = 95 # in % emissivity = 0.91 # emissivity values range from 0.90 to 0.93 # if radiative flux is given # Net_radiative_intensity = radiative_flux*(absorption/100)*(performance/100); # if radiation power is given Net_radiative_intensity = (radiation_power / (radiation_length * radiation_width)) * (absorption / 100) * ( performance / 100) * emissivity # Discretization in space ny1 = np.ceil(layer2_thickness / Ly * Ny).astype(int) ny2 = Ny - ny1 y1 = np.linspace(0, layer2_thickness, ny1) y2 = np.linspace(layer2_thickness, Ly, ny2) y = np.concatenate((y1, y2[1:])) # Initialize temperature matrix initial_temperature1 = 25 initial_temperature2 = 25 dia_roller = 0.8 # diameter of hot roller (m) dia_cooling_roller = 0.57 # diameter of cooling roller(m) contact_angle = 180 # contact angle/wrap angle for hot_roller in ° contact_angle_cool1 = 120 # contact angle/wrap angle for cooling_roller1 in ° contact_angle_cool2 = 220 # contact angle/wrap angle for cooling_roller2 in ° contact_angle_cool3 = 190 # contact angle/wrap angle for cooling_roller3 in ° y_1 = np.pi * dia_roller * contact_angle / 360 # in contact with hot roller y_2 = 0.3 # after hot roller y_3 = radiation_length # in contact with IR y_4 = 0.3 # after IR t1 = y_1 / velocity_x t2 = y_2 / velocity_x t3 = y_3 / velocity_x t4 = y_4 / velocity_x nt1 = np.ceil(t1 / (t1 + t2 + t3 + t4) * Nt).astype(int) nt2 = np.ceil(t2 / (t1 + t2 + t3 + t4) * Nt).astype(int) nt3 = np.ceil(t3 / (t1 + t2 + t3 + t4) * Nt).astype(int) nt4 = Nt - (nt1 + nt2 + nt3) t11 = np.linspace(0, t1, nt1) t12 = np.linspace(t1, t1 + t2, nt2) t13 = np.linspace(t1 + t2, t1 + t2 + t3, nt3) t14 = np.linspace(t1 + t2 + t3, t1 + t2 + t3 + t4, nt4) # pdepe settings def pdefun(y, t, u, dudy,phase): if y
Источник: https://stackoverflow.com/questions/780 ... e-argument
I am developing a model for the 1-D geometry product which is exposed to different conditions on the top and bottom surface as you can see in the code. Unfortunately, for the boundary condition, it is always giving error as bc takes multiple argument which should take single argument.
import numpy as np from scipy.integrate import solve_bvp # Constants Ly = 0.0015 # Total thickness of the system (meters) T = 40 # Total simulation time (seconds) Ny = 51 # Number of spatial grid points Nt = 50000 # Number of time steps velocity_x = 0.2 # line speed in m/s # Thermal properties of different layers layer1_thickness = 0.001 # Thickness of layer 1 (meters) layer1_k = 0.15 # Thermal conductivity of layer 1 (W/m-K) layer2_thickness = 0.5e-3 # Thickness of layer 2 (meters) layer2_k = 0.16 # Thermal conductivity of layer 2 (W/m-K) rho_1 = 1250 # density of layer 1 (kg/m³) rho_2 = 1520 # density of layer 2 (kg/m³) cp_1 = 1350 # specific heat capacity of layer 1 (J/kg-K) cp_2 = 1460 # specific heat capacity of layer 2 (J/kg-K) T_roller = 150 # Temperature of hot roller (°C) h_roller = 500 # Convective heat transfer coefficient (W/m2-K) T_cooling_roller = 22 # Temperature of cooling temperature(°C) # Ambient temperature and convection properties T_ambient = 25 # Ambient temperature (°C) h_air = 12 # Convective heat transfer coefficient of air (W/m²-K) radiation_length = 1.280 # radiation length in m radiation_width = 2.300 # radiation width in m radiation_power = 138e3 # W radiative_flux = 50e3 # W/m2 absorption = 45 # in % performance = 95 # in % emissivity = 0.91 # emissivity values range from 0.90 to 0.93 # if radiative flux is given # Net_radiative_intensity = radiative_flux*(absorption/100)*(performance/100); # if radiation power is given Net_radiative_intensity = (radiation_power / (radiation_length * radiation_width)) * (absorption / 100) * ( performance / 100) * emissivity # Discretization in space ny1 = np.ceil(layer2_thickness / Ly * Ny).astype(int) ny2 = Ny - ny1 y1 = np.linspace(0, layer2_thickness, ny1) y2 = np.linspace(layer2_thickness, Ly, ny2) y = np.concatenate((y1, y2[1:])) # Initialize temperature matrix initial_temperature1 = 25 initial_temperature2 = 25 dia_roller = 0.8 # diameter of hot roller (m) dia_cooling_roller = 0.57 # diameter of cooling roller(m) contact_angle = 180 # contact angle/wrap angle for hot_roller in ° contact_angle_cool1 = 120 # contact angle/wrap angle for cooling_roller1 in ° contact_angle_cool2 = 220 # contact angle/wrap angle for cooling_roller2 in ° contact_angle_cool3 = 190 # contact angle/wrap angle for cooling_roller3 in ° y_1 = np.pi * dia_roller * contact_angle / 360 # in contact with hot roller y_2 = 0.3 # after hot roller y_3 = radiation_length # in contact with IR y_4 = 0.3 # after IR t1 = y_1 / velocity_x t2 = y_2 / velocity_x t3 = y_3 / velocity_x t4 = y_4 / velocity_x nt1 = np.ceil(t1 / (t1 + t2 + t3 + t4) * Nt).astype(int) nt2 = np.ceil(t2 / (t1 + t2 + t3 + t4) * Nt).astype(int) nt3 = np.ceil(t3 / (t1 + t2 + t3 + t4) * Nt).astype(int) nt4 = Nt - (nt1 + nt2 + nt3) t11 = np.linspace(0, t1, nt1) t12 = np.linspace(t1, t1 + t2, nt2) t13 = np.linspace(t1 + t2, t1 + t2 + t3, nt3) t14 = np.linspace(t1 + t2 + t3, t1 + t2 + t3 + t4, nt4) # pdepe settings def pdefun(y, t, u, dudy,phase): if y
Источник: https://stackoverflow.com/questions/780 ... e-argument