complex_problems – Specialized Plugin Workflows
Complex problems package with pluggable, problem-specific workflows.
- class complex_problems.ProblemDescriptor(id, name, description)[source]
Bases:
objectDisplay metadata for a complex problem.
- complex_problems.open_problem_dialog(problem_id, parent)[source]
Open a registered complex problem dialog by id.
Registry and dialog
Registry and lazy loader for complex problem plugins.
- class complex_problems.problem_registry.ProblemRegistration(module_path, symbol_name='PROBLEM')[source]
Bases:
objectModule path and symbol name for a problem plugin.
- class complex_problems.problem_registry.ProblemRegistry(registrations)[source]
Bases:
objectLazy plugin registry for complex problems.
- Parameters:
registrations (tuple[ProblemRegistration, ...])
- complex_problems.problem_registry.open_problem_dialog(problem_id, parent)[source]
Open a registered complex problem dialog by id.
- complex_problems.problem_registry.get_problem_descriptors()[source]
Get all problem descriptors.
- Return type:
Dialog for selecting which complex problem to solve.
Common helpers
Shared helpers for complex problem plugins.
- complex_problems.common.compile_scalar_expression(expression, *, variables, parameters=None)[source]
Compile a scalar expression into a callable.
- Parameters:
- Return type:
- Returns:
Callable returning a float from the expression evaluation.
- complex_problems.common.run_solver_with_loading(*, parent, message, task, on_success, error_title='Solver Error', poll_ms=100)[source]
Run a blocking solver task on a daemon thread with a loading dialog.
- complex_problems.common.add_how_to_config_section(parent, scroll, *, problem_id, pad, wraplength=760)[source]
Add a standard collapsed ‘How to configure’ block for a problem dialog.
- Return type:
- Parameters:
parent (Frame)
scroll (ScrollableFrame)
problem_id (str)
pad (int)
wraplength (int)
- complex_problems.common.parse_float(value, *, name)[source]
Parse a floating-point value from text.
- complex_problems.common.parse_positive_float(value, *, name, min_value=0.0)[source]
Parse a positive floating-point value.
- complex_problems.common.parse_positive_int(value, *, name, min_value=1)[source]
Parse a strictly positive integer.
Background execution helper for long-running complex-problem solvers.
- complex_problems.common.background.run_solver_with_loading(*, parent, message, task, on_success, error_title='Solver Error', poll_ms=100)[source]
Run a blocking solver task on a daemon thread with a loading dialog.
Safe expression helpers for complex-problem user inputs.
- complex_problems.common.expression.compile_scalar_expression(expression, *, variables, parameters=None)[source]
Compile a scalar expression into a callable.
- Parameters:
- Return type:
- Returns:
Callable returning a float from the expression evaluation.
UI helpers for rendering shared complex-problem documentation blocks.
- complex_problems.common.problem_doc_ui.add_how_to_config_section(parent, scroll, *, problem_id, pad, wraplength=760)[source]
Add a standard collapsed ‘How to configure’ block for a problem dialog.
- Return type:
- Parameters:
parent (Frame)
scroll (ScrollableFrame)
problem_id (str)
pad (int)
wraplength (int)
Small parsing helpers for UI numeric fields.
- complex_problems.common.validation.parse_int(value, *, name)[source]
Parse an integer value from text.
- complex_problems.common.validation.parse_positive_int(value, *, name, min_value=1)[source]
Parse a strictly positive integer.
Problem documentation metadata
Shared documentation metadata for complex-problem UIs.
- class complex_problems.problem_docs.ProblemDoc(problem_type, extended_description, equation_summary, config_options_summary, visualizations_summary)[source]
Bases:
objectStructured help content for a complex problem.
- Parameters:
- complex_problems.problem_docs.get_problem_doc(problem_id)[source]
Return help content for the given problem id.
- Return type:
- Parameters:
problem_id (str)
coupled_oscillators
Coupled harmonic oscillators plugin package.
- complex_problems.coupled_oscillators.build_ode_function(n_oscillators, masses, k_coupling, boundary='fixed', coupling_types=None, nonlinear_coeff=0.0, nonlinear_fput_alpha=0.0, nonlinear_quartic=0.0, nonlinear_quintic=0.0, k_2nn=0.0, k_3nn=0.0, k_4nn=0.0, external_amplitude=0.0, external_frequency=1.0)[source]
Build the RHS for coupled oscillators with optional nonlinear terms.
- complex_problems.coupled_oscillators.solve_coupled_oscillators(n_oscillators, masses, k_coupling, boundary='fixed', coupling_types=None, nonlinear_coeff=0.0, nonlinear_fput_alpha=0.0, nonlinear_quartic=0.0, nonlinear_quintic=0.0, k_2nn=0.0, k_3nn=0.0, k_4nn=0.0, external_amplitude=0.0, external_frequency=1.0, t_min=0.0, t_max=30.0, n_points=None, y0=None, method=None)[source]
Solve the coupled oscillators system.
- Return type:
- Parameters:
n_oscillators (int)
boundary (str)
nonlinear_coeff (float)
nonlinear_fput_alpha (float)
nonlinear_quartic (float)
nonlinear_quintic (float)
k_2nn (float)
k_3nn (float)
k_4nn (float)
external_amplitude (float)
external_frequency (float)
t_min (float)
t_max (float)
n_points (int | None)
method (str | None)
Physics model for coupled harmonic oscillators.
- complex_problems.coupled_oscillators.model.build_ode_function(n_oscillators, masses, k_coupling, boundary='fixed', coupling_types=None, nonlinear_coeff=0.0, nonlinear_fput_alpha=0.0, nonlinear_quartic=0.0, nonlinear_quintic=0.0, k_2nn=0.0, k_3nn=0.0, k_4nn=0.0, external_amplitude=0.0, external_frequency=1.0)[source]
Build the RHS for coupled oscillators with optional nonlinear terms.
- complex_problems.coupled_oscillators.model.compute_normal_modes(n_oscillators, masses, k_coupling, boundary='fixed', k_2nn=0.0, k_3nn=0.0, k_4nn=0.0)[source]
Compute normal modes and angular frequencies for the linearized system.
Solver for coupled harmonic oscillators.
- class complex_problems.coupled_oscillators.solver.CoupledOscillatorsResult(x, y, n_oscillators, masses, k_coupling, M_modes, omega_modes, has_modes, metadata=<factory>)[source]
Bases:
objectResult from solving coupled oscillators.
- Parameters:
- complex_problems.coupled_oscillators.solver.solve_coupled_oscillators(n_oscillators, masses, k_coupling, boundary='fixed', coupling_types=None, nonlinear_coeff=0.0, nonlinear_fput_alpha=0.0, nonlinear_quartic=0.0, nonlinear_quintic=0.0, k_2nn=0.0, k_3nn=0.0, k_4nn=0.0, external_amplitude=0.0, external_frequency=1.0, t_min=0.0, t_max=30.0, n_points=None, y0=None, method=None)[source]
Solve the coupled oscillators system.
- Return type:
- Parameters:
n_oscillators (int)
boundary (str)
nonlinear_coeff (float)
nonlinear_fput_alpha (float)
nonlinear_quartic (float)
nonlinear_quintic (float)
k_2nn (float)
k_3nn (float)
k_4nn (float)
external_amplitude (float)
external_frequency (float)
t_min (float)
t_max (float)
n_points (int | None)
method (str | None)
UI dialog for configuring and solving coupled harmonic oscillators.
- class complex_problems.coupled_oscillators.ui.CoupledOscillatorsDialog(parent)[source]
Bases:
objectDialog for configuring coupled harmonic oscillators parameters.
- Parameters:
parent (
Tk|Toplevel) – Parent window.
Result dialog for coupled harmonic oscillators.
- class complex_problems.coupled_oscillators.result_dialog.CoupledOscillatorsResultDialog(parent, *, result)[source]
Bases:
objectResult window for coupled harmonic oscillators.
Shows tabs: Energy, Energy per mode, Animation, Heatmap, 3D Surface. Phase 1: Animation tab only. Phase 3 adds the rest.
- Parameters:
parent (
Tk|Toplevel) – Parent window.result (
CoupledOscillatorsResult) – CoupledOscillatorsResult from the solver.
membrane_2d
2D coupled-oscillator membrane complex problem.
- complex_problems.membrane_2d.solve_membrane_2d(*, u0, v0=None, t_min=0.0, t_max=20.0, dt=0.02, mass=1.0, k_linear=1.0, boundary='fixed', integrator='verlet', alpha=0.0, beta=0.0, high_order_coeff=0.0, high_order_power=5)[source]
Solve the membrane dynamics for the provided initial fields.
Physical model helpers for the 2D nonlinear membrane.
- complex_problems.membrane_2d.model.laplacian_2d(u, *, boundary)[source]
Compute the discrete 2D Laplacian.
- complex_problems.membrane_2d.model.apply_fixed_boundary(u, v=None)[source]
Clamp edges to zero in-place for fixed boundaries.
- complex_problems.membrane_2d.model.acceleration_field(u, *, mass, k_linear, boundary, alpha=0.0, beta=0.0, high_order_coeff=0.0, high_order_power=5)[source]
Compute acceleration field from linear and nonlinear membrane terms.
- complex_problems.membrane_2d.model.build_initial_displacement(*, nx, ny, shape, amplitude, sigma, mode_x=1, mode_y=1, center_x=0.5, center_y=0.5, custom_fn=None, random_seed=0, boundary='fixed')[source]
Create an initial displacement field.
- complex_problems.membrane_2d.model.compute_energy_terms(u, v, *, mass, k_linear, boundary, alpha=0.0, beta=0.0, high_order_coeff=0.0, high_order_power=5)[source]
Compute kinetic, potential, total energies.
- complex_problems.membrane_2d.model.compute_fft_power_2d(u)[source]
Compute shifted 2D power spectrum of a field.
Solver for a 2D nonlinear membrane (coupled oscillator grid).
- class complex_problems.membrane_2d.solver.Membrane2DResult(t, displacement, velocity, kinetic_energy, potential_energy, total_energy, kx, ky, spectrum_power, metadata=<factory>, magnitudes=<factory>)[source]
Bases:
objectResult bundle for the membrane solver.
- Parameters:
- complex_problems.membrane_2d.solver.solve_membrane_2d(*, u0, v0=None, t_min=0.0, t_max=20.0, dt=0.02, mass=1.0, k_linear=1.0, boundary='fixed', integrator='verlet', alpha=0.0, beta=0.0, high_order_coeff=0.0, high_order_power=5)[source]
Solve the membrane dynamics for the provided initial fields.
UI dialog for configuring a 2D nonlinear membrane simulation.
- complex_problems.membrane_2d.ui.resolve_optional_membrane_terms(selected_labels, *, alpha_text, beta_text, high_coeff_text, high_power_text)[source]
Resolve optional membrane nonlinear terms from selected labels.
- class complex_problems.membrane_2d.ui.Membrane2DDialog(parent)[source]
Bases:
objectConfiguration dialog for the membrane problem.
- Parameters:
parent (tk.Tk | tk.Toplevel)
Result dialog for the 2D nonlinear membrane.
- class complex_problems.membrane_2d.result_dialog.Membrane2DResultDialog(parent, *, result)[source]
Bases:
objectResult window for membrane simulations.
- Parameters:
parent (tk.Tk | tk.Toplevel)
result (Membrane2DResult)
nonlinear_waves
Nonlinear wave propagation complex problem (NLSE and KdV).
- complex_problems.nonlinear_waves.solve_nonlinear_waves(*, model_type, x_min, x_max, nx, t_min=0.0, t_max=10.0, dt=0.002, profile='sech', amplitude=1.0, sigma=0.3, center=0.0, custom_profile_fn=None, initial_phase_k=0.0, beta2=1.0, gamma=1.0, c=0.0, alpha=6.0, beta_disp=1.0)[source]
Solve nonlinear wave propagation for NLSE or KdV.
Model helpers for nonlinear wave solvers (NLSE and KdV).
- complex_problems.nonlinear_waves.model.build_periodic_grid(x_min, x_max, nx)[source]
Build periodic spatial grid and spectral k-grid.
- complex_problems.nonlinear_waves.model.build_initial_profile(x, *, profile, amplitude, sigma, center, custom_fn=None)[source]
Build real-valued initial profile.
- complex_problems.nonlinear_waves.model.compute_nlse_invariants(psi, *, dx, k, beta2, gamma)[source]
Compute NLSE invariants: norm, momentum, hamiltonian (approx).
- complex_problems.nonlinear_waves.model.compute_kdv_invariants(u, *, dx, k)[source]
Compute KdV invariants: mass, L2, and approximate Hamiltonian.
Pseudo-spectral solvers for nonlinear wave models (NLSE and KdV).
- class complex_problems.nonlinear_waves.solver.NonlinearWavesResult(model_type, x, t, field, magnitude, phase, k, spectrum_power, invariants, metadata=<factory>, magnitudes=<factory>)[source]
Bases:
objectResult bundle for nonlinear wave simulations.
- Parameters:
- complex_problems.nonlinear_waves.solver.solve_nonlinear_waves(*, model_type, x_min, x_max, nx, t_min=0.0, t_max=10.0, dt=0.002, profile='sech', amplitude=1.0, sigma=0.3, center=0.0, custom_profile_fn=None, initial_phase_k=0.0, beta2=1.0, gamma=1.0, c=0.0, alpha=6.0, beta_disp=1.0)[source]
Solve nonlinear wave propagation for NLSE or KdV.
UI dialog for nonlinear wave simulations (NLSE / KdV).
- class complex_problems.nonlinear_waves.ui.NonlinearWavesDialog(parent)[source]
Bases:
objectConfiguration dialog for nonlinear wave propagation models.
- Parameters:
parent (tk.Tk | tk.Toplevel)
Result dialog for nonlinear wave simulations (NLSE/KdV).
- class complex_problems.nonlinear_waves.result_dialog.NonlinearWavesResultDialog(parent, *, result)[source]
Bases:
objectResult window for nonlinear waves.
- Parameters:
parent (tk.Tk | tk.Toplevel)
result (NonlinearWavesResult)
schrodinger_td
Time-dependent Schrodinger complex problem (1D/2D).
- complex_problems.schrodinger_td.solve_schrodinger_td(*, dimension, x_min, x_max, nx, y_min=-10.0, y_max=10.0, ny=128, t_min=0.0, t_max=8.0, dt=0.002, hbar=1.0, mass=1.0, boundary='periodic', absorb_ratio=0.1, absorb_strength=1.0, potential_type='free', omega=1.0, v0=5.0, width=2.0, barrier_sigma=0.4, lattice_k=2.0, a_dw=1.0, b_dw=1.0, packet_type='gaussian', sigma=0.8, x0=0.0, y0=0.0, k0x=0.0, k0y=0.0, separation=2.0, custom_potential_fn_1d=None, custom_potential_fn_2d=None, custom_packet_fn_1d=None, custom_packet_fn_2d=None)[source]
Solve TDSE in 1D or 2D with split-operator spectral method.
- Return type:
- Parameters:
dimension (int)
x_min (float)
x_max (float)
nx (int)
y_min (float)
y_max (float)
ny (int)
t_min (float)
t_max (float)
dt (float)
hbar (float)
mass (float)
boundary (str)
absorb_ratio (float)
absorb_strength (float)
potential_type (str)
omega (float)
v0 (float)
width (float)
barrier_sigma (float)
lattice_k (float)
a_dw (float)
b_dw (float)
packet_type (str)
sigma (float)
x0 (float)
y0 (float)
k0x (float)
k0y (float)
separation (float)
Model helpers for TDSE (1D/2D) with configurable potentials.
- complex_problems.schrodinger_td.model.normalize_wavefunction_1d(psi, dx)[source]
Normalize 1D wavefunction.
- complex_problems.schrodinger_td.model.normalize_wavefunction_2d(psi, dx, dy)[source]
Normalize 2D wavefunction.
- complex_problems.schrodinger_td.model.build_absorbing_mask_1d(nx, *, ratio=0.1, strength=1.0)[source]
Build a smooth 1D absorbing boundary mask.
- complex_problems.schrodinger_td.model.build_absorbing_mask_2d(nx, ny, *, ratio=0.1, strength=1.0)[source]
Build 2D absorbing mask as outer product of 1D masks.
- complex_problems.schrodinger_td.model.potential_1d(x, *, potential_type, omega=1.0, v0=5.0, width=2.0, barrier_sigma=0.3, lattice_k=2.0, a_dw=1.0, b_dw=1.0, custom_fn=None)[source]
Build 1D potential profile.
- complex_problems.schrodinger_td.model.potential_2d(X, Y, *, potential_type, omega=1.0, v0=5.0, width=2.0, barrier_sigma=0.3, lattice_k=2.0, a_dw=1.0, b_dw=1.0, custom_fn=None)[source]
Build 2D potential surface.
- complex_problems.schrodinger_td.model.initial_packet_1d(x, *, packet_type, sigma, x0, k0x, separation=2.0, custom_fn=None)[source]
Build initial 1D packet.
- complex_problems.schrodinger_td.model.initial_packet_2d(X, Y, *, packet_type, sigma, x0, y0, k0x, k0y, separation=2.0, custom_fn=None)[source]
Build initial 2D packet.
Split-operator spectral solver for time-dependent Schrodinger equation.
- class complex_problems.schrodinger_td.solver.SchrodingerTDResult(dimension, x, y, t, psi, magnitude, phase, potential, kx, ky, spectrum_power, invariants, metadata=<factory>, magnitudes=<factory>)[source]
Bases:
objectResult bundle for TDSE simulations.
- Parameters:
- complex_problems.schrodinger_td.solver.solve_schrodinger_td(*, dimension, x_min, x_max, nx, y_min=-10.0, y_max=10.0, ny=128, t_min=0.0, t_max=8.0, dt=0.002, hbar=1.0, mass=1.0, boundary='periodic', absorb_ratio=0.1, absorb_strength=1.0, potential_type='free', omega=1.0, v0=5.0, width=2.0, barrier_sigma=0.4, lattice_k=2.0, a_dw=1.0, b_dw=1.0, packet_type='gaussian', sigma=0.8, x0=0.0, y0=0.0, k0x=0.0, k0y=0.0, separation=2.0, custom_potential_fn_1d=None, custom_potential_fn_2d=None, custom_packet_fn_1d=None, custom_packet_fn_2d=None)[source]
Solve TDSE in 1D or 2D with split-operator spectral method.
- Return type:
- Parameters:
dimension (int)
x_min (float)
x_max (float)
nx (int)
y_min (float)
y_max (float)
ny (int)
t_min (float)
t_max (float)
dt (float)
hbar (float)
mass (float)
boundary (str)
absorb_ratio (float)
absorb_strength (float)
potential_type (str)
omega (float)
v0 (float)
width (float)
barrier_sigma (float)
lattice_k (float)
a_dw (float)
b_dw (float)
packet_type (str)
sigma (float)
x0 (float)
y0 (float)
k0x (float)
k0y (float)
separation (float)
UI dialog for configuring time-dependent Schrödinger simulations.
- class complex_problems.schrodinger_td.ui.SchrodingerTDDialog(parent)[source]
Bases:
objectConfiguration dialog for TDSE in 1D and 2D.
- Parameters:
parent (tk.Tk | tk.Toplevel)
Result dialog for time-dependent Schrodinger simulations.
- class complex_problems.schrodinger_td.result_dialog.SchrodingerTDResultDialog(parent, *, result)[source]
Bases:
objectResult window for TDSE 1D/2D.
- Parameters:
parent (tk.Tk | tk.Toplevel)
result (SchrodingerTDResult)
antenna_radiation
Antenna radiation complex problem plugin.
- complex_problems.antenna_radiation.solve_antenna_radiation(*, antenna_type='dipole', frequency_hz=1000000000.0, transmit_power_w=10.0, efficiency=0.9, observation_distance_m=50.0, n_theta=181, n_phi=360, length_lambda=0.5, loop_radius_lambda=0.1, patch_length_lambda=0.5, patch_width_lambda=0.4, array_elements=8, array_spacing_lambda=0.5, array_phase_deg=0.0, array_steer_theta_deg=90.0)[source]
Solve a far-field antenna radiation case.
- Return type:
- Parameters:
antenna_type (str)
frequency_hz (float)
transmit_power_w (float)
efficiency (float)
observation_distance_m (float)
n_theta (int)
n_phi (int)
length_lambda (float)
loop_radius_lambda (float)
patch_length_lambda (float)
patch_width_lambda (float)
array_elements (int)
array_spacing_lambda (float)
array_phase_deg (float)
array_steer_theta_deg (float)
Model helpers for far-field antenna radiation patterns.
- complex_problems.antenna_radiation.model.build_angular_grid(n_theta, n_phi)[source]
Build theta/phi angular grids.
- complex_problems.antenna_radiation.model.pattern_dipole(theta_grid, *, length_lambda)[source]
Approximate thin-wire dipole power pattern.
- complex_problems.antenna_radiation.model.pattern_small_loop(theta_grid, *, radius_lambda)[source]
Small-loop-like power pattern.
- complex_problems.antenna_radiation.model.pattern_patch(theta_grid, phi_grid, *, length_lambda, width_lambda)[source]
Simple aperture-model patch-like power pattern.
- complex_problems.antenna_radiation.model.pattern_uniform_linear_array(theta_grid, *, n_elements, spacing_lambda, phase_deg, steer_theta_deg)[source]
Uniform linear array factor power (array axis z, theta from z).
- complex_problems.antenna_radiation.model.antenna_pattern(*, antenna_type, theta, phi, length_lambda, loop_radius_lambda, patch_length_lambda, patch_width_lambda, array_elements, array_spacing_lambda, array_phase_deg, array_steer_theta_deg)[source]
Build raw non-normalized power pattern on theta-phi mesh.
- complex_problems.antenna_radiation.model.compute_directivity(p_norm, theta, phi)[source]
Compute directivity map from normalized pattern.
- complex_problems.antenna_radiation.model.estimate_beamwidth_deg(theta, cut_power)[source]
Estimate -3 dB beamwidth from a theta cut.
- complex_problems.antenna_radiation.model.estimate_aperture_lambda(*, antenna_type, length_lambda, loop_radius_lambda, patch_length_lambda, patch_width_lambda, array_elements, array_spacing_lambda)[source]
Estimate largest physical dimension in wavelengths.
- complex_problems.antenna_radiation.model.to_db10(x, *, floor_db=-80.0)[source]
Convert linear values to dB with floor.
- complex_problems.antenna_radiation.model.wavelength_from_frequency(frequency_hz)[source]
Compute free-space wavelength.
- complex_problems.antenna_radiation.model.far_field_distance_min(wavelength, aperture_lambda)[source]
Fraunhofer minimum far-field distance.
- complex_problems.antenna_radiation.model.e_from_power_density(power_density)[source]
Convert power density to RMS electric field magnitude.
- complex_problems.antenna_radiation.model.h_from_e_field(e_rms)[source]
Convert RMS electric field to RMS magnetic field.
- complex_problems.antenna_radiation.model.compute_reaction_metrics(*, directivity, gain, theta, phi, p_norm)[source]
Compute scalar quality metrics from solved patterns.
Analytical far-field solver for antenna radiation patterns.
- class complex_problems.antenna_radiation.solver.AntennaRadiationResult(antenna_type, theta, phi, pattern_norm, directivity, directivity_db, gain, gain_db, power_density, e_rms, h_rms, theta_cut_db, phi_cut_db, metadata=<factory>, magnitudes=<factory>)[source]
Bases:
objectResult bundle for antenna radiation problem.
- complex_problems.antenna_radiation.solver.solve_antenna_radiation(*, antenna_type='dipole', frequency_hz=1000000000.0, transmit_power_w=10.0, efficiency=0.9, observation_distance_m=50.0, n_theta=181, n_phi=360, length_lambda=0.5, loop_radius_lambda=0.1, patch_length_lambda=0.5, patch_width_lambda=0.4, array_elements=8, array_spacing_lambda=0.5, array_phase_deg=0.0, array_steer_theta_deg=90.0)[source]
Solve a far-field antenna radiation case.
- Return type:
- Parameters:
antenna_type (str)
frequency_hz (float)
transmit_power_w (float)
efficiency (float)
observation_distance_m (float)
n_theta (int)
n_phi (int)
length_lambda (float)
loop_radius_lambda (float)
patch_length_lambda (float)
patch_width_lambda (float)
array_elements (int)
array_spacing_lambda (float)
array_phase_deg (float)
array_steer_theta_deg (float)
UI dialog for configuring antenna radiation simulations.
- class complex_problems.antenna_radiation.ui.AntennaRadiationDialog(parent)[source]
Bases:
objectConfiguration dialog for antenna radiation patterns.
- Parameters:
parent (tk.Tk | tk.Toplevel)
Result dialog for antenna radiation simulations.
- class complex_problems.antenna_radiation.result_dialog.AntennaRadiationResultDialog(parent, *, result)[source]
Bases:
objectResult window for antenna radiation problem.
- Parameters:
parent (tk.Tk | tk.Toplevel)
result (AntennaRadiationResult)
aerodynamics_2d
Aerodynamics complex problem plugin.
- complex_problems.aerodynamics_2d.solve_aerodynamics_2d(*, approximation='nonlinear_ns', nx=96, ny=64, lx=4.0, ly=2.0, t_max=2.0, dt=0.002, sample_every=10, rho=1.0, nu=0.01, u_inf=1.0, penalization=0.005, obstacle_shape='cylinder', obstacle_center_x=1.3, obstacle_center_y=1.0, obstacle_size_x=0.3, obstacle_size_y=0.3, obstacle_attack_deg=0.0)[source]
Solve 2D incompressible flow in a periodic box with an immersed obstacle.
- Return type:
- Parameters:
approximation (str)
nx (int)
ny (int)
lx (float)
ly (float)
t_max (float)
dt (float)
sample_every (int)
rho (float)
nu (float)
u_inf (float)
penalization (float)
obstacle_shape (str)
obstacle_center_x (float)
obstacle_center_y (float)
obstacle_size_x (float)
obstacle_size_y (float)
obstacle_attack_deg (float)
Geometry and field helpers for 2D aerodynamics.
- complex_problems.aerodynamics_2d.model.build_periodic_domain(*, nx, ny, lx, ly)[source]
Build periodic domain coordinates and mesh.
- complex_problems.aerodynamics_2d.model.rotate_coordinates(X, Y, *, center_x, center_y, angle_deg)[source]
Rotate coordinates around obstacle center.
- complex_problems.aerodynamics_2d.model.build_obstacle_mask(*, shape, X, Y, center_x, center_y, size_x, size_y, attack_deg)[source]
Build obstacle mask and reference scales.
- complex_problems.aerodynamics_2d.model.laplacian_periodic(f, dx, dy)[source]
Periodic 2D Laplacian.
- complex_problems.aerodynamics_2d.model.divergence_periodic(u, v, dx, dy)[source]
Periodic divergence.
- complex_problems.aerodynamics_2d.model.vorticity_periodic(u, v, dx, dy)[source]
Periodic scalar vorticity.
2D incompressible aerodynamics solver with obstacle penalization.
- class complex_problems.aerodynamics_2d.solver.Aerodynamics2DResult(x, y, t, u, v, pressure, speed, vorticity, obstacle_mask, drag_coeff, lift_coeff, metadata=<factory>, magnitudes=<factory>)[source]
Bases:
objectResult bundle for 2D aerodynamics simulation.
- Parameters:
- complex_problems.aerodynamics_2d.solver.solve_aerodynamics_2d(*, approximation='nonlinear_ns', nx=96, ny=64, lx=4.0, ly=2.0, t_max=2.0, dt=0.002, sample_every=10, rho=1.0, nu=0.01, u_inf=1.0, penalization=0.005, obstacle_shape='cylinder', obstacle_center_x=1.3, obstacle_center_y=1.0, obstacle_size_x=0.3, obstacle_size_y=0.3, obstacle_attack_deg=0.0)[source]
Solve 2D incompressible flow in a periodic box with an immersed obstacle.
- Return type:
- Parameters:
approximation (str)
nx (int)
ny (int)
lx (float)
ly (float)
t_max (float)
dt (float)
sample_every (int)
rho (float)
nu (float)
u_inf (float)
penalization (float)
obstacle_shape (str)
obstacle_center_x (float)
obstacle_center_y (float)
obstacle_size_x (float)
obstacle_size_y (float)
obstacle_attack_deg (float)
UI dialog for configuring 2D aerodynamics simulations.
- class complex_problems.aerodynamics_2d.ui.Aerodynamics2DDialog(parent)[source]
Bases:
objectConfiguration dialog for 2D aerodynamic flow solver.
- Parameters:
parent (tk.Tk | tk.Toplevel)
Result dialog for 2D aerodynamics simulations.
- class complex_problems.aerodynamics_2d.result_dialog.Aerodynamics2DResultDialog(parent, *, result)[source]
Bases:
objectResult window for 2D aerodynamics.
- Parameters:
parent (tk.Tk | tk.Toplevel)
result (Aerodynamics2DResult)
pipe_flow
Pipe flow complex problem plugin.
- complex_problems.pipe_flow.solve_pipe_flow(*, model_type='steady', length=20.0, nx=256, profile='constant', d_in=0.08, d_out=0.05, d0=0.06, profile_amplitude=0.2, profile_waves=2.0, custom_diameter_fn=None, rho=1000.0, mu=0.001, roughness=1e-05, friction_model='auto', p_in=200000.0, p_out=190000.0, p_base=200000.0, p_amp=2000.0, p_freq_hz=2.0, wave_speed=200.0, damping=0.2, t_max=1.0, dt=0.0005, sample_every=10)[source]
Solve steady or transient 1D pipe flow.
- Return type:
- Parameters:
model_type (str)
length (float)
nx (int)
profile (str)
d_in (float)
d_out (float)
d0 (float)
profile_amplitude (float)
profile_waves (float)
rho (float)
mu (float)
roughness (float)
friction_model (str)
p_in (float)
p_out (float)
p_base (float)
p_amp (float)
p_freq_hz (float)
wave_speed (float)
damping (float)
t_max (float)
dt (float)
sample_every (int)
Model helpers for 1D pipe flow.
- complex_problems.pipe_flow.model.diameter_profile(x, *, profile, d_in, d_out, d0, amplitude, n_waves, custom_fn=None)[source]
Build diameter profile along x.
- complex_problems.pipe_flow.model.reynolds_number(rho, mu, velocity, diameter)[source]
Compute Reynolds number profile.
- complex_problems.pipe_flow.model.friction_factor(re, *, roughness, diameter, model)[source]
Compute Darcy friction factor.
Steady and transient 1D pipe-flow solvers.
- class complex_problems.pipe_flow.solver.PipeFlowResult(model_type, x, t, diameter, area, pressure, velocity, reynolds, friction, flow_rate_mean, flow_rate_std, metadata=<factory>, magnitudes=<factory>)[source]
Bases:
objectResult bundle for pipe-flow simulations.
- Parameters:
- complex_problems.pipe_flow.solver.solve_pipe_flow(*, model_type='steady', length=20.0, nx=256, profile='constant', d_in=0.08, d_out=0.05, d0=0.06, profile_amplitude=0.2, profile_waves=2.0, custom_diameter_fn=None, rho=1000.0, mu=0.001, roughness=1e-05, friction_model='auto', p_in=200000.0, p_out=190000.0, p_base=200000.0, p_amp=2000.0, p_freq_hz=2.0, wave_speed=200.0, damping=0.2, t_max=1.0, dt=0.0005, sample_every=10)[source]
Solve steady or transient 1D pipe flow.
- Return type:
- Parameters:
model_type (str)
length (float)
nx (int)
profile (str)
d_in (float)
d_out (float)
d0 (float)
profile_amplitude (float)
profile_waves (float)
rho (float)
mu (float)
roughness (float)
friction_model (str)
p_in (float)
p_out (float)
p_base (float)
p_amp (float)
p_freq_hz (float)
wave_speed (float)
damping (float)
t_max (float)
dt (float)
sample_every (int)
UI dialog for configuring pipe-flow simulations.
- class complex_problems.pipe_flow.ui.PipeFlowDialog(parent)[source]
Bases:
objectConfiguration dialog for steady and transient pipe flow.
- Parameters:
parent (tk.Tk | tk.Toplevel)
Result dialog for pipe-flow simulations.
- class complex_problems.pipe_flow.result_dialog.PipeFlowResultDialog(parent, *, result)[source]
Bases:
objectResult window for steady/transient pipe flow.
- Parameters:
parent (tk.Tk | tk.Toplevel)
result (PipeFlowResult)