pyserep.pipeline

pyserep.pipeline — ROMConfig and SereпPipeline orchestrator.

class pyserep.pipeline.PipelineResults(config: ROMConfig, freqs_hz: ndarray = <factory>, phi: ndarray = <factory>, selected_modes: ndarray = <factory>, master_dofs: ndarray = <factory>, T: ndarray | None = None, Ka: ndarray | None = None, Ma: ndarray | None = None, kappa: float = inf, freq_errors: ndarray | None = None, max_freq_err: float = nan, frf: FRFResult | None = None, validation: ValidationReport | None = None, performance: PerformanceMetrics | None = None, saved_files: Dict[str, str]=<factory>, elapsed_total_s: float = 0.0)[source]

Bases: object

All outputs from a completed SEREP ROM pipeline run.

config
Type:

ROMConfig

freqs_hz

All computed natural frequencies (Hz).

Type:

np.ndarray

phi

Full modal matrix (N × n_modes).

Type:

np.ndarray

selected_modes
Type:

np.ndarray of int

master_dofs
Type:

np.ndarray of int

T

SEREP transformation matrix (N × m).

Type:

np.ndarray

Ka, Ma

Reduced stiffness and mass matrices (m × m).

Type:

np.ndarray

kappa

Condition number κ(Φₐ).

Type:

float

freq_errors

Per-mode eigenvalue preservation errors (%).

Type:

np.ndarray

max_freq_err
Type:

float

frf
Type:

FRFResult

validation
Type:

ValidationReport

performance
Type:

PerformanceMetrics

elapsed_total_s
Type:

float

saved_files
Type:

dict

Ka: ndarray | None = None
Ma: ndarray | None = None
T: ndarray | None = None
config: ROMConfig
elapsed_total_s: float = 0.0
freq_errors: ndarray | None = None
freqs_hz: ndarray
frf: FRFResult | None = None
kappa: float = inf
master_dofs: ndarray
max_freq_err: float = nan
performance: PerformanceMetrics | None = None
phi: ndarray
saved_files: Dict[str, str]
selected_modes: ndarray
summary() str[source]

Return a formatted string with all key pipeline results and metrics.

validation: ValidationReport | None = None
class pyserep.pipeline.ROMConfig(stiffness_file: str = '', mass_file: str = '', force_dofs: List[int] = <factory>, output_dofs: List[int] = <factory>, bands: List[FrequencyBand] | None = None, freq_range: Tuple[float, float]=(0.1, 500.0), frf_method: str = 'direct', damping_type: str = 'modal', zeta: float = 0.001, n_points_per_band: int = 2000, num_modes_eigsh: int = 100, eigsh_sigma: float = 0.01, eigsh_tol: float = 1e-10, ms1_alpha: float = 1.5, ms2_threshold: float = 1.0, ms3_threshold: float = 5.0, mac_threshold: float = 0.9, rb_hz: float = 1.0, dof_method: str = 'eid', ke_prescreen_frac: float = 0.5, export_folder: str = 'pyserep_output', save_prefix: str = 'SEREP', save_matrices: bool = True, plot: bool = True, verbose: bool = True)[source]

Bases: object

Complete configuration for a SEREP ROM pipeline run.

bands: List[FrequencyBand] | None = None
damping_type: str = 'modal'
dof_method: str = 'eid'
property effective_bands: List[FrequencyBand]

Resolved list of FrequencyBand objects (from bands or freq_range).

eigsh_sigma: float = 0.01
eigsh_tol: float = 1e-10
export_folder: str = 'pyserep_output'
force_dofs: List[int]
freq_range: Tuple[float, float] = (0.1, 500.0)
frf_method: str = 'direct'
property global_f_max: float

Maximum frequency across all analysis bands (Hz).

property global_f_min: float

Minimum frequency across all analysis bands (Hz).

property is_selective: bool

True when there are two or more bands (gap regions exist).

ke_prescreen_frac: float = 0.5
mac_threshold: float = 0.9
mass_file: str = ''
ms1_alpha: float = 1.5
ms2_threshold: float = 1.0
ms3_threshold: float = 5.0
property n_bands: int

Number of analysis frequency bands.

property n_pairs: int

Number of force/output DOF pairs.

n_points_per_band: int = 2000
num_modes_eigsh: int = 100
output_dofs: List[int]
plot: bool = True
rb_hz: float = 1.0
save_matrices: bool = True
save_prefix: str = 'SEREP'
stiffness_file: str = ''
summary() str[source]

Return a formatted string listing all configuration parameters.

verbose: bool = True
zeta: float = 0.001
class pyserep.pipeline.SereпPipeline(config: ROMConfig)[source]

Bases: object

Orchestrates the complete SEREP ROM pipeline.

Parameters:

config (ROMConfig)

Examples

Full-range analysis with direct FRF:

>>> cfg = ROMConfig(
...     stiffness_file="K.mtx",
...     mass_file="M.mtx",
...     force_dofs=[3000],
...     output_dofs=[3000],
...     freq_range=(0.1, 500.0),
...     frf_method="direct",
... )
>>> results = SereпPipeline(cfg).run()

Selective bands:

>>> from pyserep import FrequencyBand
>>> cfg = ROMConfig(
...     stiffness_file="K.mtx",
...     mass_file="M.mtx",
...     force_dofs=[3000],
...     output_dofs=[3000],
...     bands=[FrequencyBand(0, 100), FrequencyBand(400, 500)],
... )
>>> results = SereпPipeline(cfg).run()
run() PipelineResults[source]

Execute the full pipeline and return PipelineResults.