Oakfield API Documentation 1.0.0
Numerical core APIs
Loading...
Searching...
No Matches
hysteretic.h File Reference

Hysteretic operator with Schmitt, play, and Bouc-Wen modes. Supports matching real or complex input/output fields. More...

Include dependency graph for hysteretic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SimHystereticOperatorConfig
 Configuration for hysteretic operators. More...
 

Typedefs

typedef enum SimHystereticMode SimHystereticMode
 Hysteresis mode selection.
 
typedef enum SimHystereticThresholdMode SimHystereticThresholdMode
 Threshold specification strategy.
 
typedef enum SimHystereticInputMode SimHystereticInputMode
 Input preprocessing options.
 
typedef struct SimHystereticOperatorConfig SimHystereticOperatorConfig
 Configuration for hysteretic operators.
 

Enumerations

enum  SimHystereticMode { SIM_HYSTERETIC_MODE_SCHMITT = 0 , SIM_HYSTERETIC_MODE_PLAY , SIM_HYSTERETIC_MODE_BOUC_WEN }
 Hysteresis mode selection. More...
 
enum  SimHystereticThresholdMode { SIM_HYSTERETIC_THRESHOLD_BOUNDS = 0 , SIM_HYSTERETIC_THRESHOLD_CENTER_WIDTH }
 Threshold specification strategy. More...
 
enum  SimHystereticInputMode { SIM_HYSTERETIC_INPUT_DIRECT = 0 , SIM_HYSTERETIC_INPUT_ABS , SIM_HYSTERETIC_INPUT_SQUARED }
 Input preprocessing options. More...
 

Functions

SimResult sim_add_hysteretic_operator (struct SimContext *context, const SimHystereticOperatorConfig *config, size_t *out_index)
 Registers a hysteretic operator instance.
 
SimResult sim_hysteretic_config (struct SimContext *context, size_t operator_index, SimHystereticOperatorConfig *out_config)
 Retrieve the configuration currently bound to a hysteretic operator.
 
SimResult sim_hysteretic_update (struct SimContext *context, size_t operator_index, const SimHystereticOperatorConfig *config)
 Update an existing hysteretic operator in-place.
 

Detailed Description

Hysteretic operator with Schmitt, play, and Bouc-Wen modes. Supports matching real or complex input/output fields.

Enumeration Type Documentation

◆ SimHystereticInputMode

Input preprocessing options.

Enumerator
SIM_HYSTERETIC_INPUT_DIRECT 

Use input samples directly.

SIM_HYSTERETIC_INPUT_ABS 

Use absolute value of input.

SIM_HYSTERETIC_INPUT_SQUARED 

Use squared input.

◆ SimHystereticMode

Hysteresis mode selection.

Enumerator
SIM_HYSTERETIC_MODE_SCHMITT 

Binary Schmitt trigger.

SIM_HYSTERETIC_MODE_PLAY 

Continuous play/deadband operator.

SIM_HYSTERETIC_MODE_BOUC_WEN 

Dynamic Bouc-Wen hysteresis model.

◆ SimHystereticThresholdMode

Threshold specification strategy.

Enumerator
SIM_HYSTERETIC_THRESHOLD_BOUNDS 

Use (threshold_low, threshold_high).

SIM_HYSTERETIC_THRESHOLD_CENTER_WIDTH 

Use (threshold_center, threshold_width).

Function Documentation

◆ sim_add_hysteretic_operator()

SimResult sim_add_hysteretic_operator ( struct SimContext context,
const SimHystereticOperatorConfig config,
size_t *  out_index 
)

Registers a hysteretic operator instance.

Parameters
contextSimulation context that will own the operator.
configOptional hysteretic configuration; NULL selects normalized defaults.
[out]out_indexOptional destination for the registered operator index.
Returns
SIM_RESULT_OK on success, or an error code from argument validation, field compatibility checks, allocation, or split registration.

◆ sim_hysteretic_config()

SimResult sim_hysteretic_config ( struct SimContext context,
size_t  operator_index,
SimHystereticOperatorConfig out_config 
)

Retrieve the configuration currently bound to a hysteretic operator.

Parameters
contextSimulation context containing the operator.
operator_indexIndex returned by sim_add_hysteretic_operator().
[out]out_configReceives the normalized configuration.
Returns
SIM_RESULT_OK on success, SIM_RESULT_INVALID_ARGUMENT for NULL pointers, SIM_RESULT_NOT_FOUND for a missing operator, or SIM_RESULT_INVALID_STATE when the operator has no hysteretic state.

◆ sim_hysteretic_update()

SimResult sim_hysteretic_update ( struct SimContext context,
size_t  operator_index,
const SimHystereticOperatorConfig config 
)

Update an existing hysteretic operator in-place.

config is required. A successful update normalizes the replacement, validates field compatibility, resets internal history initialization, and invalidates the scheduler plan.

Parameters
contextSimulation context containing the operator.
operator_indexIndex of the hysteretic operator to update.
configReplacement hysteretic configuration.
Returns
SIM_RESULT_OK on success, or an error code from argument validation, lookup, field compatibility checks, or state validation.