VeraGridEngine.Simulations.EMT.JMARTI_Sim packageο
Submodulesο
VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_fit_bundle moduleο
- class VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_fit_bundle.JMartiFitBundle(frequency_hz: ndarray, line_length_m: float, phase_labels: tuple[str, ...], modal_transform: ndarray, modal_transform_inv: ndarray, reference_frequency_hz: float, decoupling_error_z: ndarray, decoupling_error_y: ndarray, mode_delays: Sequence[JMartiModeDelayEstimate], yc_fits: Sequence[JMartiRationalModeFit], hres_fits: Sequence[JMartiRationalModeFit], passivity_report: JMartiPassivityReport | None)[source]ο
Bases:
objectAggregated offline JMARTI fitting product ready for runtime conversion.
The fitting pipeline produces modal preprocessing, per-mode delay estimates, per-mode rational fits and optional passivity diagnostics. This object keeps those pieces together under one typed interface before the EMT runtime layer discretizes and consumes them.
- get_decoupling_error_y() ndarray[source]ο
Return the off-diagonal Y decoupling errors.
- Returns:
Real-valued Y decoupling error vector.
- get_decoupling_error_z() ndarray[source]ο
Return the off-diagonal Z decoupling errors.
- Returns:
Real-valued Z decoupling error vector.
- get_frequency_hz() ndarray[source]ο
Return the fitted frequency grid.
- Returns:
Frequency grid in Hz.
- get_hres_fits() tuple[JMartiRationalModeFit, ...][source]ο
Return the scalar
Hresfits.- Returns:
Per-mode
Hresfit tuple.
- get_line_length_m() float[source]ο
Return the line length in meters.
- Returns:
Line length in meters.
- get_modal_transform() ndarray[source]ο
Return the frozen modal transform.
- Returns:
Complex modal transform.
- get_modal_transform_inv() ndarray[source]ο
Return the inverse frozen modal transform.
- Returns:
Inverse modal transform.
- get_mode_delays() tuple[JMartiModeDelayEstimate, ...][source]ο
Return the modal delay estimates.
- Returns:
Per-mode delay tuple.
- get_passivity_report() JMartiPassivityReport | None[source]ο
Return the optional passivity report.
- Returns:
Passivity report or
None.
- get_phase_labels() tuple[str, ...][source]ο
Return the ordered phase labels.
- Returns:
Ordered phase-label tuple.
- get_reference_frequency_hz() float[source]ο
Return the frequency used to freeze the modal basis.
- Returns:
Reference frequency in Hz.
- get_yc_fits() tuple[JMartiRationalModeFit, ...][source]ο
Return the scalar
Ycfits.- Returns:
Per-mode
Ycfit tuple.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_fit_bundle.build_jmarti_fit_bundle(modal_samples: JMartiModalSamples, mode_delays: Sequence[JMartiModeDelayEstimate], yc_fits: Sequence[JMartiRationalModeFit], hres_fits: Sequence[JMartiRationalModeFit], passivity_report: JMartiPassivityReport | None = None) JMartiFitBundle[source]ο
Build one validated JMARTI fit bundle.
- Parameters:
modal_samples β Modal preprocessing output.
mode_delays β Per-mode delay estimates.
yc_fits β Per-mode
Ycrational fits.hres_fits β Per-mode
Hresrational fits.passivity_report β Optional passivity report.
- Returns:
Validated fit bundle.
- Raises:
ValueError β If the per-mode objects do not align.
VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_fit_options moduleο
- class VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_fit_options.JMartiFitOptions(reference_frequency_hz: float = 0.0, use_frequency_exploration_window: bool = False, exploration_low_hz: float = 0.0, exploration_high_hz: float = 0.0, use_delay_fit_window: bool = False, delay_fit_low_hz: float = 0.0, delay_fit_high_hz: float = 0.0, decoupling_warning_tolerance: float = 0.01, loewner_relative_tolerance: float = 1e-08, maximum_model_order: int = 40, forced_model_order: int = 0, minimum_frequency_samples: int = 4, vf_max_iterations: int = 8, vf_pole_shift_tolerance: float = 1e-06, vf_enforce_stable_poles: bool = True, vf_stability_real_part_floor: float = 1e-08, vf_include_constant_term: bool = True, vf_include_proportional_term: bool = False, passivity_frequency_sample_count: int = 1024, passivity_minimum_real_yc_tolerance: float = 1e-08, passivity_maximum_hres_gain_tolerance: float = 1e-06)[source]ο
Bases:
OptionsTemplateUser-configurable numerical options for the JMARTI fitting workflow.
The fitting stages must remain externally configurable because real line data sets vary strongly in frequency span, modal coupling, and required rational order. The object centralizes all public knobs used by the current offline preprocessing stages.
- CLASS_NON_EDITABLE_PROPERTIES: Tuple[str, ...] = ('idtag', 'diff_changes')ο
- CLASS_PROPERTIES_WITH_PROFILE: Dict[str, str] = {}ο
- CLASS_PROPERTY_DECLARATIONS: Tuple[GCProp, ...] = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:comment, prop:diff_changes, prop:reference_frequency_hz, prop:use_frequency_exploration_window, prop:exploration_low_hz, prop:exploration_high_hz, prop:use_delay_fit_window, prop:delay_fit_low_hz, prop:delay_fit_high_hz, prop:decoupling_warning_tolerance, prop:loewner_relative_tolerance, prop:maximum_model_order, prop:forced_model_order, prop:minimum_frequency_samples, prop:vf_max_iterations, prop:vf_pole_shift_tolerance, prop:vf_enforce_stable_poles, prop:vf_stability_real_part_floor, prop:vf_include_constant_term, prop:vf_include_proportional_term, prop:passivity_frequency_sample_count, prop:passivity_minimum_real_yc_tolerance, prop:passivity_maximum_hres_gain_tolerance)ο
- CLASS_PROPERTY_LIST: Tuple[GCProp, ...] = (prop:idtag, prop:name, prop:code, prop:rdfid, prop:action, prop:comment, prop:diff_changes, prop:reference_frequency_hz, prop:use_frequency_exploration_window, prop:exploration_low_hz, prop:exploration_high_hz, prop:use_delay_fit_window, prop:delay_fit_low_hz, prop:delay_fit_high_hz, prop:decoupling_warning_tolerance, prop:loewner_relative_tolerance, prop:maximum_model_order, prop:forced_model_order, prop:minimum_frequency_samples, prop:vf_max_iterations, prop:vf_pole_shift_tolerance, prop:vf_enforce_stable_poles, prop:vf_stability_real_part_floor, prop:vf_include_constant_term, prop:vf_include_proportional_term, prop:passivity_frequency_sample_count, prop:passivity_minimum_real_yc_tolerance, prop:passivity_maximum_hres_gain_tolerance)ο
- CLASS_REGISTERED_PROPERTIES: Dict[str, GCProp] = {'action': prop:action, 'code': prop:code, 'comment': prop:comment, 'decoupling_warning_tolerance': prop:decoupling_warning_tolerance, 'delay_fit_high_hz': prop:delay_fit_high_hz, 'delay_fit_low_hz': prop:delay_fit_low_hz, 'diff_changes': prop:diff_changes, 'exploration_high_hz': prop:exploration_high_hz, 'exploration_low_hz': prop:exploration_low_hz, 'forced_model_order': prop:forced_model_order, 'idtag': prop:idtag, 'loewner_relative_tolerance': prop:loewner_relative_tolerance, 'maximum_model_order': prop:maximum_model_order, 'minimum_frequency_samples': prop:minimum_frequency_samples, 'name': prop:name, 'passivity_frequency_sample_count': prop:passivity_frequency_sample_count, 'passivity_maximum_hres_gain_tolerance': prop:passivity_maximum_hres_gain_tolerance, 'passivity_minimum_real_yc_tolerance': prop:passivity_minimum_real_yc_tolerance, 'rdfid': prop:rdfid, 'reference_frequency_hz': prop:reference_frequency_hz, 'use_delay_fit_window': prop:use_delay_fit_window, 'use_frequency_exploration_window': prop:use_frequency_exploration_window, 'vf_enforce_stable_poles': prop:vf_enforce_stable_poles, 'vf_include_constant_term': prop:vf_include_constant_term, 'vf_include_proportional_term': prop:vf_include_proportional_term, 'vf_max_iterations': prop:vf_max_iterations, 'vf_pole_shift_tolerance': prop:vf_pole_shift_tolerance, 'vf_stability_real_part_floor': prop:vf_stability_real_part_floor}ο
- LOCAL_PROPERTY_DECLARATIONS: Tuple[GCProp, ...] = (prop:reference_frequency_hz, prop:use_frequency_exploration_window, prop:exploration_low_hz, prop:exploration_high_hz, prop:use_delay_fit_window, prop:delay_fit_low_hz, prop:delay_fit_high_hz, prop:decoupling_warning_tolerance, prop:loewner_relative_tolerance, prop:maximum_model_order, prop:forced_model_order, prop:minimum_frequency_samples, prop:vf_max_iterations, prop:vf_pole_shift_tolerance, prop:vf_enforce_stable_poles, prop:vf_stability_real_part_floor, prop:vf_include_constant_term, prop:vf_include_proportional_term, prop:passivity_frequency_sample_count, prop:passivity_minimum_real_yc_tolerance, prop:passivity_maximum_hres_gain_tolerance)ο
- property decoupling_warning_tolerance: floatο
Property wrapper for the modal decoupling tolerance.
- Returns:
Non-negative error tolerance.
- property delay_fit_high_hz: floatο
Property wrapper for the upper delay-fit edge.
- Returns:
Upper edge in Hz.
- property delay_fit_low_hz: floatο
Property wrapper for the lower delay-fit edge.
- Returns:
Lower edge in Hz.
- property exploration_high_hz: floatο
Property wrapper for the upper fitting-band edge.
- Returns:
Upper edge in Hz.
- property exploration_low_hz: floatο
Property wrapper for the lower fitting-band edge.
- Returns:
Lower edge in Hz.
- property forced_model_order: intο
Property wrapper for the forced model order.
- Returns:
Forced order, or
0when automatic.
- get_decoupling_warning_tolerance() float[source]ο
Return the maximum acceptable modal decoupling error.
- Returns:
Non-negative error tolerance.
- get_delay_fit_high_hz() float[source]ο
Return the upper edge of the delay-fit band.
- Returns:
Upper edge in Hz.
- get_delay_fit_low_hz() float[source]ο
Return the lower edge of the delay-fit band.
- Returns:
Lower edge in Hz.
- get_exploration_high_hz() float[source]ο
Return the upper edge of the fitting band.
- Returns:
Upper edge in Hz.
- get_exploration_low_hz() float[source]ο
Return the lower edge of the fitting band.
- Returns:
Lower edge in Hz.
- get_forced_model_order() int[source]ο
Return the user-forced rational order.
- Returns:
Forced order, or
0when order estimation remains automatic.
- get_loewner_relative_tolerance() float[source]ο
Return the relative Loewner singular-value tolerance.
- Returns:
Positive relative tolerance.
- get_maximum_model_order() int[source]ο
Return the maximum rational order allowed by the user.
- Returns:
Positive order cap.
- get_minimum_frequency_samples() int[source]ο
Return the minimum number of frequency samples required.
- Returns:
Minimum sample count.
- get_passivity_frequency_sample_count() int[source]ο
Return the dense frequency-grid size used for passivity checks.
- Returns:
Positive sample count.
- get_passivity_maximum_hres_gain_tolerance() float[source]ο
Return the allowed gain slack above unity for
|Hres(jw)|.- Returns:
Non-negative tolerance.
- get_passivity_minimum_real_yc_tolerance() float[source]ο
Return the allowed negativity slack for
Re(Yc(jw)).- Returns:
Non-negative tolerance.
- get_reference_frequency_hz() float[source]ο
Return the reference frequency used to freeze the modal basis.
- Returns:
Reference frequency in Hz.
0.0means automatic.
- get_use_delay_fit_window() bool[source]ο
Return whether the delay-fit band restriction is enabled.
- Returns:
Boolean state.
- get_use_frequency_exploration_window() bool[source]ο
Return whether the fitting band restriction is enabled.
- Returns:
Boolean state.
- get_vf_enforce_stable_poles() bool[source]ο
Return whether unstable poles must be reflected into the left half-plane.
- Returns:
Boolean state.
- get_vf_include_constant_term() bool[source]ο
Return whether the rational fit includes one constant term.
- Returns:
Boolean state.
- get_vf_include_proportional_term() bool[source]ο
Return whether the rational fit includes one proportional
sterm.- Returns:
Boolean state.
- get_vf_max_iterations() int[source]ο
Return the maximum number of Vector Fitting relocation iterations.
- Returns:
Positive iteration cap.
- get_vf_pole_shift_tolerance() float[source]ο
Return the Vector Fitting pole-shift stopping tolerance.
- Returns:
Positive relative tolerance.
- get_vf_stability_real_part_floor() float[source]ο
Return the minimum absolute negative real part used after pole reflection.
- Returns:
Positive floor value.
- property loewner_relative_tolerance: floatο
Property wrapper for the Loewner singular-value tolerance.
- Returns:
Positive relative tolerance.
- property maximum_model_order: intο
Property wrapper for the maximum model order.
- Returns:
Positive order cap.
- property minimum_frequency_samples: intο
Property wrapper for the minimum sample count.
- Returns:
Minimum sample count.
- property passivity_frequency_sample_count: intο
Property wrapper for the passivity frequency-grid size.
- Returns:
Positive sample count.
- property passivity_maximum_hres_gain_tolerance: floatο
Property wrapper for the
|Hres|gain slack tolerance.- Returns:
Non-negative tolerance.
- property passivity_minimum_real_yc_tolerance: floatο
Property wrapper for the
Re(Yc)negativity tolerance.- Returns:
Non-negative tolerance.
- property reference_frequency_hz: floatο
Property wrapper for the reference frequency.
- Returns:
Reference frequency in Hz.
- set_decoupling_warning_tolerance(value: float) None[source]ο
Set the maximum acceptable modal decoupling error.
- Parameters:
value β Requested non-negative tolerance.
- Returns:
None.
- set_delay_fit_high_hz(value: float) None[source]ο
Set the upper edge of the delay-fit band.
- Parameters:
value β Requested upper edge in Hz.
- Returns:
None.
- set_delay_fit_low_hz(value: float) None[source]ο
Set the lower edge of the delay-fit band.
- Parameters:
value β Requested lower edge in Hz.
- Returns:
None.
- set_exploration_high_hz(value: float) None[source]ο
Set the upper edge of the fitting band.
- Parameters:
value β Requested upper edge in Hz.
- Returns:
None.
- set_exploration_low_hz(value: float) None[source]ο
Set the lower edge of the fitting band.
- Parameters:
value β Requested lower edge in Hz.
- Returns:
None.
- set_forced_model_order(value: int) None[source]ο
Set the user-forced rational order.
- Parameters:
value β Requested order.
0keeps automatic order estimation.- Returns:
None.
- set_loewner_relative_tolerance(value: float) None[source]ο
Set the relative Loewner singular-value tolerance.
- Parameters:
value β Requested positive tolerance.
- Returns:
None.
- set_maximum_model_order(value: int) None[source]ο
Set the maximum rational order allowed by the user.
- Parameters:
value β Requested positive order cap.
- Returns:
None.
- set_minimum_frequency_samples(value: int) None[source]ο
Set the minimum number of frequency samples required.
- Parameters:
value β Requested minimum sample count.
- Returns:
None.
- set_passivity_frequency_sample_count(value: int) None[source]ο
Set the dense frequency-grid size used for passivity checks.
- Parameters:
value β Requested positive sample count.
- Returns:
None.
- set_passivity_maximum_hres_gain_tolerance(value: float) None[source]ο
Set the allowed gain slack above unity for
|Hres(jw)|.- Parameters:
value β Requested non-negative tolerance.
- Returns:
None.
- set_passivity_minimum_real_yc_tolerance(value: float) None[source]ο
Set the allowed negativity slack for
Re(Yc(jw)).- Parameters:
value β Requested non-negative tolerance.
- Returns:
None.
- set_reference_frequency_hz(value: float) None[source]ο
Set the reference frequency used to freeze the modal basis.
- Parameters:
value β Requested reference frequency in Hz.
- Returns:
None.
- set_use_delay_fit_window(value: bool) None[source]ο
Enable or disable the delay-fit band restriction.
- Parameters:
value β Requested boolean state.
- Returns:
None.
- set_use_frequency_exploration_window(value: bool) None[source]ο
Enable or disable the fitting band restriction.
- Parameters:
value β Requested boolean state.
- Returns:
None.
- set_vf_enforce_stable_poles(value: bool) None[source]ο
Enable or disable pole reflection into the left half-plane.
- Parameters:
value β Requested boolean state.
- Returns:
None.
- set_vf_include_constant_term(value: bool) None[source]ο
Enable or disable the constant term in the rational fit.
- Parameters:
value β Requested boolean state.
- Returns:
None.
- set_vf_include_proportional_term(value: bool) None[source]ο
Enable or disable the proportional
sterm in the rational fit.- Parameters:
value β Requested boolean state.
- Returns:
None.
- set_vf_max_iterations(value: int) None[source]ο
Set the maximum number of Vector Fitting relocation iterations.
- Parameters:
value β Requested positive iteration cap.
- Returns:
None.
- set_vf_pole_shift_tolerance(value: float) None[source]ο
Set the Vector Fitting pole-shift stopping tolerance.
- Parameters:
value β Requested positive relative tolerance.
- Returns:
None.
- set_vf_stability_real_part_floor(value: float) None[source]ο
Set the minimum absolute negative real part used after pole reflection.
- Parameters:
value β Requested positive floor value.
- Returns:
None.
- property use_delay_fit_window: boolο
Property wrapper for the delay-fit band restriction flag.
- Returns:
Boolean state.
- property use_frequency_exploration_window: boolο
Property wrapper for the fitting band restriction flag.
- Returns:
Boolean state.
- property vf_enforce_stable_poles: boolο
Property wrapper for the stable-pole enforcement flag.
- Returns:
Boolean state.
- property vf_include_constant_term: boolο
Property wrapper for the constant-term flag.
- Returns:
Boolean state.
- property vf_include_proportional_term: boolο
Property wrapper for the proportional-term flag.
- Returns:
Boolean state.
- property vf_max_iterations: intο
Property wrapper for the Vector Fitting iteration cap.
- Returns:
Positive iteration cap.
- property vf_pole_shift_tolerance: floatο
Property wrapper for the Vector Fitting pole-shift tolerance.
- Returns:
Positive relative tolerance.
- property vf_stability_real_part_floor: floatο
Property wrapper for the reflected-pole real-part floor.
- Returns:
Positive floor value.
VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_fit_workflow moduleο
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_fit_workflow.build_jmarti_fit_bundle_from_frequency_samples(samples: JMartiFrequencySamples, options: JMartiFitOptions | None = None) JMartiFitBundle[source]ο
Run the full first-generation JMARTI fitting pipeline on one sample set.
The helper centralizes the modal preprocessing, delay extraction, Loewner seeding, Vector Fitting, and passivity-like checks so higher layers such as the GUI can trigger one consistent offline preprocessing workflow.
- Parameters:
samples β Frequency-domain line dataset.
options β Optional user-configurable fit options.
- Returns:
Offline JMARTI fit bundle.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_fit_workflow.build_jmarti_frequency_grid(low_hz: float, high_hz: float, sample_count: int) ndarray[source]ο
Build one monotone frequency grid for one JMARTI preprocessing run.
The GUI-driven fitting flow lets the user configure the exploration band and the number of samples used to interrogate the line model. Positive lower limits use logarithmic spacing, while bands starting at zero fall back to an affine grid.
- Parameters:
low_hz β Lower frequency bound in Hz.
high_hz β Upper frequency bound in Hz.
sample_count β Number of requested samples.
- Returns:
Frequency vector in Hz.
- Raises:
ValueError β If the requested band is invalid.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_fit_workflow.build_jmarti_frequency_samples_from_line(line: Line, phase_n: bool, phase_a: bool, phase_b: bool, phase_c: bool, low_hz: float, high_hz: float, sample_count: int, nominal_frequency_hz: float | None = None, sbase_mva: float | None = None) JMartiFrequencySamples[source]ο
Build one JMARTI frequency-domain dataset from one physical line object.
The GUI-driven flow targets concrete
Linedevices backed by one overhead, sequence, or underground template. When the template still carries conductor geometry, the sweep is evaluated directly over frequency. Otherwise the first implementation falls back to one frequency-independent RLGC extrapolation reconstructed from the nominal template values.- Parameters:
line β Concrete line device being edited.
phase_n β Whether the neutral is enabled on the EMT block.
phase_a β Whether phase A is enabled.
phase_b β Whether phase B is enabled.
phase_c β Whether phase C is enabled.
low_hz β Lower sweep frequency in Hz.
high_hz β Upper sweep frequency in Hz.
sample_count β Number of sweep samples.
nominal_frequency_hz β Optional nominal frequency used to reconstruct RLGC sweeps.
sbase_mva β System base power in MVA used to convert the line data to per unit.
- Returns:
Frequency-domain JMARTI sample set.
- Raises:
ValueError β If the line cannot provide compatible data.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_fit_workflow.build_jmarti_hres_modal_responses(modal_samples: JMartiModalSamples, mode_delays: Sequence[JMartiModeDelayEstimate]) ndarray[source]ο
Build the residual propagation responses fitted as
Hresper mode.Hresis the propagation operator left after extracting one pure delay from each modal channel. It combines attenuation and the residual dispersive phase not captured by the affine delay estimate.- Parameters:
modal_samples β Modalized frequency samples.
mode_delays β Per-mode delay estimates.
- Returns:
Complex response matrix with shape
(nf, nmodes).- Raises:
ValueError β If the modal objects do not align.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_fit_workflow.load_jmarti_frequency_samples_from_npz(file_path: str, phase_n: bool, phase_a: bool, phase_b: bool, phase_c: bool, fallback_line_length_m: float | None = None) JMartiFrequencySamples[source]ο
Load one JMARTI frequency-domain sample set from one NPZ archive.
Required arrays: -
frequency_hzwith shape(nf,)-z_per_lengthorz_per_length_real/z_per_length_imagwith shape(nf, np, np)-y_per_lengthory_per_length_real/y_per_length_imagwith shape(nf, np, np)Optional arrays: -
phase_labelswith shape(np,)-line_length_mscalarUnit convention: -
z_per_lengthmust already be expressed in per-unit per meter -y_per_lengthmust already be expressed in per-unit per meter- Parameters:
file_path β NPZ file path.
phase_n β Whether the neutral is enabled.
phase_a β Whether phase A is enabled.
phase_b β Whether phase B is enabled.
phase_c β Whether phase C is enabled.
fallback_line_length_m β Optional line-length fallback in meters.
- Returns:
Imported and validated frequency-domain samples.
- Raises:
ValueError β If the archive is missing required data.
VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_frequency_samples moduleο
- class VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_frequency_samples.JMartiFrequencySamples(frequency_hz: Sequence[float], z_per_length: ndarray, y_per_length: ndarray, line_length_m: float, phase_labels: Sequence[str])[source]ο
Bases:
objectTyped container holding frequency-domain line samples for one JMARTI fit.
The fitting workflow starts from sampled multiconductor series impedance and shunt admittance matrices. The container validates all structural assumptions once so every later fitting stage can rely on a coherent input.
- get_angular_frequency_rad_per_s() ndarray[source]ο
Return the sampled angular-frequency vector.
- Returns:
Angular-frequency vector in rad/s.
- get_frequency_count() int[source]ο
Return the number of sampled frequencies.
- Returns:
Number of frequency samples.
- get_frequency_hz() ndarray[source]ο
Return the sampled frequency vector.
- Returns:
Frequency vector in Hz.
- get_line_length_m() float[source]ο
Return the physical line length in meters.
- Returns:
Line length in meters.
- get_phase_count() int[source]ο
Return the number of conductors or phases in the sample set.
- Returns:
Matrix dimension.
- get_phase_labels() tuple[str, ...][source]ο
Return the ordered phase labels.
- Returns:
Ordered phase-label tuple.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_frequency_samples.build_jmarti_frequency_samples(frequency_hz: Sequence[float], z_per_length: ndarray, y_per_length: ndarray, line_length_m: float, phase_labels: Sequence[str]) JMartiFrequencySamples[source]ο
Build one validated JMARTI frequency-sample container.
- Parameters:
frequency_hz β Strictly increasing frequency samples in Hz.
z_per_length β Series impedance matrices with shape
(nf, np, np).y_per_length β Shunt admittance matrices with shape
(nf, np, np).line_length_m β Physical line length in meters.
phase_labels β Ordered phase labels associated with the matrices.
- Returns:
Validated frequency-sample container.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_frequency_samples.build_jmarti_frequency_subset(samples: JMartiFrequencySamples, low_hz: float, high_hz: float) JMartiFrequencySamples[source]ο
Build one frequency-window subset of a JMARTI sample set.
- Parameters:
samples β Full sample set.
low_hz β Lower retained frequency in Hz.
high_hz β Upper retained frequency in Hz.
- Returns:
Windowed sample set.
- Raises:
ValueError β If the requested window leaves too few samples.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_frequency_samples.validate_jmarti_frequency_samples(samples: JMartiFrequencySamples) None[source]ο
Validate one JMARTI frequency-sample container.
- Parameters:
samples β Frequency-sample container to validate.
- Returns:
None.
- Raises:
ValueError β If the sample set is structurally inconsistent.
VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_loewner_seed moduleο
- class VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_loewner_seed.JMartiModeLoewnerSeed(mode_index: int, target_name: str, left_frequencies_hz: ndarray, right_frequencies_hz: ndarray, singular_values: ndarray, estimated_order: int, initial_poles_s: ndarray, truncation_ratio: float)[source]ο
Bases:
objectLoewner-based order and pole seed for one scalar JMARTI modal target.
The class stores the reduced-order information that later feeds the Vector Fitting stage. The seed is intentionally scalar per mode because the first JMARTI implementation in VeraGrid fits each modal channel independently.
- get_initial_poles_s() ndarray[source]ο
Return the initial continuous-time poles.
- Returns:
Complex pole vector.
- get_left_frequencies_hz() ndarray[source]ο
Return the left frequency subset.
- Returns:
Left sample frequencies in Hz.
- get_right_frequencies_hz() ndarray[source]ο
Return the right frequency subset.
- Returns:
Right sample frequencies in Hz.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_loewner_seed.build_jmarti_loewner_left_right_partition(frequency_hz: ndarray, response_values: ndarray, minimum_frequency_samples: int) Tuple[ndarray, ndarray, ndarray, ndarray][source]ο
Split one scalar frequency response into interleaved left and right subsets.
The Loewner framework requires two disjoint sampling sets. Interleaving the original frequency grid preserves broad-band coverage on both sides without introducing user-tuned partition heuristics in the first implementation.
- Parameters:
frequency_hz β Strictly increasing frequency samples in Hz.
response_values β Complex scalar response samples on the same grid.
minimum_frequency_samples β Minimum number of total samples required by the user options.
- Returns:
Tuple
(left_f_hz, right_f_hz, left_resp, right_resp).- Raises:
ValueError β If the sample vectors are too short or inconsistent.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_loewner_seed.build_jmarti_loewner_matrices(left_frequencies_hz: ndarray, right_frequencies_hz: ndarray, left_response: ndarray, right_response: ndarray) Tuple[ndarray, ndarray][source]ο
Build the Loewner and shifted-Loewner matrices for one scalar response.
- Parameters:
left_frequencies_hz β Left frequency subset in Hz.
right_frequencies_hz β Right frequency subset in Hz.
left_response β Complex response samples on the left subset.
right_response β Complex response samples on the right subset.
- Returns:
Tuple
(L, Ls).
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_loewner_seed.build_jmarti_mode_loewner_seed(frequency_hz: Sequence[float], response_values: ndarray, target_name: str, mode_index: int, options: JMartiFitOptions | None = None) JMartiModeLoewnerSeed[source]ο
Build one Loewner seed bundle for a scalar JMARTI modal target.
- Parameters:
frequency_hz β Strictly increasing frequency grid in Hz.
response_values β Complex scalar response samples on that grid.
target_name β Modal target name, for example
YcorHres.mode_index β Modal channel index.
options β Optional user-configurable JMARTI fitting options.
- Returns:
Loewner seed bundle.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_loewner_seed.estimate_jmarti_loewner_order(singular_values: ndarray, relative_tolerance: float, maximum_order: int, forced_model_order: int) Tuple[int, float][source]ο
Estimate one reduced order from Loewner singular values.
- Parameters:
singular_values β Singular-value vector in descending order.
relative_tolerance β Relative truncation tolerance.
maximum_order β Optional maximum order clamp.
forced_model_order β Fixed user order.
0means automatic.
- Returns:
Tuple
(estimated_order, truncation_ratio).
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_loewner_seed.extract_jmarti_loewner_initial_poles(loewner_matrix: ndarray, shifted_loewner_matrix: ndarray, estimated_order: int) ndarray[source]ο
Extract one set of continuous-time poles from the reduced Loewner pencil.
- Parameters:
loewner_matrix β Loewner matrix.
shifted_loewner_matrix β Shifted Loewner matrix.
estimated_order β Reduced order used for projection.
- Returns:
Complex initial pole vector.
VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_modal_processing moduleο
- class VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_modal_processing.JMartiModalSamples(frequency_hz: ndarray, line_length_m: float, phase_labels: tuple[str, ...], modal_transform: ndarray, modal_transform_inv: ndarray, z_modal: ndarray, y_modal: ndarray, z_modal_diag: ndarray, y_modal_diag: ndarray, gamma_modal: ndarray, yc_modal: ndarray, decoupling_error_z: ndarray, decoupling_error_y: ndarray, reference_frequency_hz: float)[source]ο
Bases:
objectModalized JMARTI frequency samples built from one constant modal transform.
The first JMARTI implementation in VeraGrid assumes an approximately constant modal basis over the fitted band. The object stores that common basis and all diagonal modal quantities derived from it.
- get_angular_frequency_rad_per_s() ndarray[source]ο
Return the modal angular-frequency grid.
- Returns:
Angular-frequency grid in rad/s.
- get_decoupling_error_y() ndarray[source]ο
Return the off-diagonal Y decoupling errors.
- Returns:
Real-valued error vector over frequency.
- get_decoupling_error_z() ndarray[source]ο
Return the off-diagonal Z decoupling errors.
- Returns:
Real-valued error vector over frequency.
- get_frequency_hz() ndarray[source]ο
Return the modal frequency grid.
- Returns:
Frequency grid in Hz.
- get_gamma_modal() ndarray[source]ο
Return the modal propagation constants per unit length.
- Returns:
Complex modal propagation constants.
- get_line_length_m() float[source]ο
Return the line length in meters.
- Returns:
Line length in meters.
- get_modal_transform() ndarray[source]ο
Return the common modal transform.
- Returns:
Complex modal transform.
- get_modal_transform_inv() ndarray[source]ο
Return the inverse common modal transform.
- Returns:
Inverse modal transform.
- get_phase_labels() tuple[str, ...][source]ο
Return the ordered phase labels.
- Returns:
Ordered phase-label tuple.
- get_reference_frequency_hz() float[source]ο
Return the frequency used to freeze the modal basis.
- Returns:
Reference frequency in Hz.
- get_y_modal() ndarray[source]ο
Return projected modal shunt-admittance matrices.
- Returns:
Complex modal admittance tensor.
- get_y_modal_diag() ndarray[source]ο
Return the diagonal modal admittance samples.
- Returns:
Complex diagonal modal admittance array.
- get_yc_modal() ndarray[source]ο
Return the modal characteristic admittances.
- Returns:
Complex modal characteristic-admittance array.
- class VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_modal_processing.JMartiModeDelayEstimate(mode_index: int, tau_s: float, rms_phase_error_rad: float)[source]ο
Bases:
objectDelay estimate of one modal propagation channel.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_modal_processing.build_jmarti_modal_samples(samples: JMartiFrequencySamples, options: JMartiFitOptions | None = None) JMartiModalSamples[source]ο
Build modal JMARTI samples from one frequency-domain line dataset.
The first JMARTI implementation freezes one common modal basis at a single reference frequency and reuses it across the whole fitted band. This is the standard pragmatic starting point before moving to a fully frequency-varying modal transform.
- Parameters:
samples β Frequency-domain line dataset.
options β Optional user-configurable JMARTI fitting options.
- Returns:
Modalized sample set.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_modal_processing.estimate_jmarti_mode_delays(modal_samples: JMartiModalSamples, options: JMartiFitOptions | None = None) list[JMartiModeDelayEstimate][source]ο
Estimate one pure propagation delay for each JMARTI mode.
The pure delay is extracted from the modal propagation phase
beta(omega) * lengththrough one affine fit in angular frequency. The residual phase error indicates how much non-ideal frequency dispersion is left for the rational residual propagation fit.- Parameters:
modal_samples β Modalized JMARTI sample set.
options β Optional user-configurable JMARTI fitting options.
- Returns:
Delay estimates for every modal channel.
VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_passivity moduleο
- class VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_passivity.JMartiModePassivityReport(mode_index: int, target_name: str, minimum_real_part: float, maximum_gain: float, minimum_real_frequency_hz: float, maximum_gain_frequency_hz: float, passes_real_part_check: bool, passes_gain_check: bool)[source]ο
Bases:
objectPassivity-like and boundedness metrics for one scalar JMARTI mode.
The first JMARTI implementation treats the modal channels independently. For that reason the physical admissibility checks are also scalar per mode:
Re(Yc)must remain non-negative within tolerance and|Hres|must not exceed one beyond the configured slack.- get_maximum_gain() float[source]ο
Return the maximum sampled magnitude.
- Returns:
Maximum sampled magnitude.
- get_maximum_gain_frequency_hz() float[source]ο
Return the frequency where the maximum magnitude occurs.
- Returns:
Frequency in Hz.
- get_minimum_real_frequency_hz() float[source]ο
Return the frequency where the minimum real part occurs.
- Returns:
Frequency in Hz.
- get_minimum_real_part() float[source]ο
Return the minimum sampled real part.
- Returns:
Minimum sampled real part.
- get_passes_gain_check() bool[source]ο
Return whether the gain admissibility test passes.
- Returns:
Boolean state.
- class VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_passivity.JMartiPassivityReport(frequency_hz: ndarray, mode_reports: Sequence[JMartiModePassivityReport])[source]ο
Bases:
objectAggregate passivity-like report for a set of scalar JMARTI fits.
- get_all_checks_pass() bool[source]ο
Return whether every mode passes its admissibility checks.
- Returns:
Boolean global status.
- get_frequency_hz() ndarray[source]ο
Return the dense frequency grid used for the checks.
- Returns:
Dense frequency grid in Hz.
- get_mode_reports() tuple[JMartiModePassivityReport, ...][source]ο
Return the per-mode reports.
- Returns:
Per-mode report tuple.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_passivity.build_jmarti_passivity_frequency_grid(low_hz: float, high_hz: float, sample_count: int) ndarray[source]ο
Build one dense frequency grid for passivity checks.
- Parameters:
low_hz β Lower frequency in Hz.
high_hz β Upper frequency in Hz.
sample_count β Number of samples requested by the user.
- Returns:
Dense logarithmic or affine frequency grid.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_passivity.evaluate_jmarti_mode_passivity(fit: JMartiRationalModeFit, frequency_hz: Sequence[float], options: JMartiFitOptions | None = None) JMartiModePassivityReport[source]ο
Evaluate one scalar JMARTI mode on a dense frequency grid.
Ycis checked through its minimum real part, while propagation-like targets such asHresare checked through their maximum gain.- Parameters:
fit β Scalar rational fit.
frequency_hz β Dense frequency grid in Hz.
options β Optional user-configurable JMARTI fitting options.
- Returns:
Scalar passivity/boundedness report.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_passivity.evaluate_jmarti_passivity_report(fits: Sequence[JMartiRationalModeFit], low_hz: float, high_hz: float, options: JMartiFitOptions | None = None) JMartiPassivityReport[source]ο
Evaluate passivity-like metrics for a set of scalar JMARTI fits.
- Parameters:
fits β Scalar rational fits to inspect.
low_hz β Lower frequency of the dense check grid.
high_hz β Upper frequency of the dense check grid.
options β Optional user-configurable JMARTI fitting options.
- Returns:
Aggregate passivity report.
VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_runtime moduleο
- class VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_runtime.JMartiHistoryRuntime(line: Any, line_block: Block, h: float)[source]ο
Bases:
objectRuntime companion for a JMARTI line in reduced active-phase space.
The first implementation uses a constant modal basis and one scalar fit per mode. The runtime keeps all convolution-like states internally and exposes only phase-domain Norton history current injections back to the EMT solver.
- active_ph: List[str]ο
- bind_terminals(v_f_vars: List[Any], v_t_vars: List[Any]) None[source]ο
Bind the bus terminal voltage variables for the active phases only.
- Parameters:
v_f_vars β Full from-side bus voltage variable list in NABC order.
v_t_vars β Full to-side bus voltage variable list in NABC order.
- Returns:
None.
- blockο
- buf_a_f: ndarrayο
- buf_a_t: ndarrayο
- buffer_size: intο
- direct_yc_modal: ndarrayο
- direct_yc_phase: ndarrayο
- direct_zc_modal: ndarrayο
- get_mode_count() int[source]ο
Return the number of modal channels carried by the runtime.
- Returns:
Number of modal channels.
- get_nodal_injections() Tuple[List[Any], List[Any]][source]ο
Return the phase-domain Norton injections seen by the EMT nodal solver.
- Returns:
Tuple
(i_from_full, i_to_full)in fixed NABC order.
- hο
- hres_order_counts: ndarrayο
- hres_state_from: ndarrayο
- hres_state_to: ndarrayο
- idx_p_hfο
- idx_p_htο
- idx_vfο
- idx_vtο
- initialize_from_fundamental_phasors(v_f0_phasor_red: ndarray, v_t0_phasor_red: ndarray, i_f0_phasor_red: ndarray, i_t0_phasor_red: ndarray, system_frequency_hz: float) tuple[ndarray, ndarray][source]ο
Initialize one JMARTI runtime from one sinusoidal fundamental operating point.
The runtime states represent first-order discrete filters, so their consistent steady state under a balanced sinusoidal operating point is not the constant-input equilibrium. This initializer seeds the internal modal states with the periodic discrete-time solution at the requested fundamental frequency.
- Parameters:
v_f0_phasor_red β From-side phase phasors in RMS complex form.
v_t0_phasor_red β To-side phase phasors in RMS complex form.
i_f0_phasor_red β From-side branch-current phasors in RMS complex form.
i_t0_phasor_red β To-side branch-current phasors in RMS complex form.
system_frequency_hz β Fundamental system frequency in Hz.
- Returns:
Tuple
(ih_f_phase, ih_t_phase)used to seed event parameters.
- initialize_from_initial_point(v_f0_red: ndarray, v_t0_red: ndarray, i_f0_red: ndarray, i_t0_red: ndarray) tuple[ndarray, ndarray][source]ο
Initialize buffers and history parameters from one steady-state point.
- Parameters:
v_f0_red β From-side active-phase voltages in phase coordinates.
v_t0_red β To-side active-phase voltages in phase coordinates.
i_f0_red β From-side active-phase currents in phase coordinates.
i_t0_red β To-side active-phase currents in phase coordinates.
- Returns:
Tuple
(ih_f_phase, ih_t_phase)used to seed event parameters.
- lineο
- m: intο
- max_delay_steps: intο
- ph_labels: List[str]ο
- ph_mask: ndarrayο
- phase_idx: List[int]ο
- runtime_dataο
- setup_indices(uid2idx_vars: dict, uid2idx_event_params: dict, params_offset: int = 0) None[source]ο
Bind solver indices used during the history update.
- Parameters:
uid2idx_vars β Variable index map.
uid2idx_event_params β Event-parameter index map.
params_offset β Runtime-parameter offset.
- Returns:
None.
- update_history(step_counter: int, x_prev: ndarray, full_params: ndarray) None[source]ο
Update the retained JMARTI history injections after one accepted EMT step.
- Parameters:
step_counter β Current accepted step counter.
x_prev β Previous accepted state vector.
full_params β Flat runtime parameter vector.
- Returns:
None.
- v_f_varsο
- v_t_varsο
- yc_order_counts: ndarrayο
- yc_state_from: ndarrayο
- yc_state_to: ndarrayο
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_runtime.get_jmarti_block_fit_bundle(block: Block | None) JMartiFitBundle | None[source]ο
Return the optional JMARTI fit bundle attached to one EMT block.
- Parameters:
block β Candidate EMT block.
- Returns:
Attached fit bundle or
None.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_runtime.get_jmarti_block_runtime_data(block: Block | None) JMartiRuntimeData | None[source]ο
Return the optional JMARTI runtime data attached to one EMT block.
- Parameters:
block β Candidate EMT block.
- Returns:
Attached runtime data or
None.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_runtime.set_jmarti_block_fit_bundle(block: Block, fit_bundle: JMartiFitBundle | None) None[source]ο
Attach one optional JMARTI fit bundle to one EMT block.
- Parameters:
block β Target EMT block.
fit_bundle β Optional offline fit bundle.
- Returns:
None.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_runtime.set_jmarti_block_runtime_data(block: Block, runtime_data: JMartiRuntimeData | None) None[source]ο
Attach one optional discretized JMARTI runtime data object to one EMT block.
- Parameters:
block β Target EMT block.
runtime_data β Optional runtime data.
- Returns:
None.
VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_runtime_data moduleο
- class VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_runtime_data.JMartiModeRuntimeData(mode_index: int, tau_s: float, delay_step_count: int, residual_delay_s: float, yc_poles_s: ndarray, yc_residues: ndarray, yc_constant_term: complex, yc_proportional_term: complex, hres_poles_s: ndarray, hres_residues: ndarray, hres_constant_term: complex, hres_proportional_term: complex, yc_alpha: ndarray, yc_beta: ndarray, hres_alpha: ndarray, hres_beta: ndarray)[source]ο
Bases:
objectDiscrete-time runtime coefficients of one scalar JMARTI modal channel.
The EMT runtime will later consume these coefficients directly instead of re-discretizing every pole on the fly. This keeps the time-stepping loop as lean as possible.
- get_delay_step_count() int[source]ο
Return the integer delay in EMT steps.
- Returns:
Integer delay in EMT steps.
- get_hres_alpha() ndarray[source]ο
Return the exact discrete state-transition multipliers of
Hres.- Returns:
Complex transition multipliers.
- get_hres_beta() ndarray[source]ο
Return the exact discrete input gains of
Hres.- Returns:
Complex input gains.
- get_hres_constant_term() complex[source]ο
Return the constant term of
Hres.- Returns:
Complex constant term of
Hres.
- get_hres_poles_s() ndarray[source]ο
Return the continuous-time poles of
Hres.- Returns:
Complex pole vector of
Hres.
- get_hres_proportional_term() complex[source]ο
Return the proportional term of
Hres.- Returns:
Complex proportional term of
Hres.
- get_hres_residues() ndarray[source]ο
Return the residues of
Hres.- Returns:
Complex residue vector of
Hres.
- get_residual_delay_s() float[source]ο
Return the unresolved sub-step delay in seconds.
- Returns:
Residual delay in seconds.
- get_yc_alpha() ndarray[source]ο
Return the exact discrete state-transition multipliers of
Yc.- Returns:
Complex transition multipliers.
- get_yc_beta() ndarray[source]ο
Return the exact discrete input gains of
Yc.- Returns:
Complex input gains.
- get_yc_constant_term() complex[source]ο
Return the constant term of
Yc.- Returns:
Complex constant term of
Yc.
- get_yc_poles_s() ndarray[source]ο
Return the continuous-time poles of
Yc.- Returns:
Complex pole vector of
Yc.
- class VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_runtime_data.JMartiRuntimeData(time_step_s: float, line_length_m: float, phase_labels: tuple[str, ...], modal_transform: ndarray, modal_transform_inv: ndarray, reference_frequency_hz: float, mode_data: tuple[JMartiModeRuntimeData, ...])[source]ο
Bases:
objectRuntime-ready discrete JMARTI data built from one offline fit bundle.
- get_line_length_m() float[source]ο
Return the line length in meters.
- Returns:
Line length in meters.
- get_modal_transform() ndarray[source]ο
Return the frozen modal transform.
- Returns:
Complex modal transform.
- get_modal_transform_inv() ndarray[source]ο
Return the inverse frozen modal transform.
- Returns:
Inverse modal transform.
- get_mode_data() tuple[JMartiModeRuntimeData, ...][source]ο
Return the discrete modal runtime records.
- Returns:
Modal runtime tuple.
- get_phase_labels() tuple[str, ...][source]ο
Return the ordered phase labels.
- Returns:
Ordered phase-label tuple.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_runtime_data.build_jmarti_runtime_data(fit_bundle: JMartiFitBundle, time_step_s: float) JMartiRuntimeData[source]ο
Build runtime-ready discrete JMARTI coefficients from one offline fit bundle.
- Parameters:
fit_bundle β Offline JMARTI fit bundle.
time_step_s β EMT time step in seconds.
- Returns:
Runtime-ready JMARTI dataset.
- Raises:
ValueError β If the time step is not strictly positive.
VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_vector_fit moduleο
- class VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_vector_fit.JMartiRationalModeFit(mode_index: int, target_name: str, poles_s: ndarray, residues: ndarray, constant_term: complex, proportional_term: complex, fit_error_rms: float, max_relative_error: float, iterations_completed: int, converged: bool, stable: bool)[source]ο
Bases:
objectScalar rational fit of one JMARTI modal target.
The first JMARTI implementation fits each modal channel independently. The object stores the resulting pole-residue form together with explicit error metrics so later passivity and runtime stages can inspect the fit quality.
- get_constant_term() complex[source]ο
Return the fitted constant term.
- Returns:
Complex constant term.
- get_converged() bool[source]ο
Return whether the relocation loop converged.
- Returns:
Boolean convergence flag.
- get_fit_error_rms() float[source]ο
Return the relative RMS fit error.
- Returns:
Relative RMS fit error.
- get_iterations_completed() int[source]ο
Return the number of pole-relocation iterations performed.
- Returns:
Completed iteration count.
- get_max_relative_error() float[source]ο
Return the maximum pointwise relative fit error.
- Returns:
Maximum relative fit error.
- get_poles_s() ndarray[source]ο
Return the fitted continuous-time poles.
- Returns:
Complex pole vector.
- get_proportional_term() complex[source]ο
Return the fitted proportional term.
- Returns:
Complex proportional term.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_vector_fit.build_jmarti_complex_frequency_points(frequency_hz: Sequence[float]) ndarray[source]ο
Map one real frequency grid to the continuous-time imaginary axis.
- Parameters:
frequency_hz β Frequency grid in Hz.
- Returns:
Complex s-plane samples
j*2*pi*f.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_vector_fit.build_jmarti_mode_vector_fit(frequency_hz: Sequence[float], response_values: ndarray, loewner_seed: JMartiModeLoewnerSeed, options: JMartiFitOptions | None = None) JMartiRationalModeFit[source]ο
Build one scalar Vector Fitting refinement from a Loewner seed.
- Parameters:
frequency_hz β Frequency grid in Hz.
response_values β Complex scalar response samples on that grid.
loewner_seed β Loewner order/pole seed.
options β Optional user-configurable JMARTI fitting options.
- Returns:
Scalar rational fit.
- VeraGridEngine.Simulations.EMT.JMARTI_Sim.jmarti_vector_fit.evaluate_jmarti_rational_mode_fit(fit: JMartiRationalModeFit, frequency_hz: Sequence[float]) ndarray[source]ο
Evaluate one fitted scalar rational mode on the imaginary axis.
- Parameters:
fit β Fitted scalar rational mode.
frequency_hz β Frequency grid in Hz.
- Returns:
Complex response samples.