|
DYNAMICS C API
C-compatible interface to the DYNAMICS library
|
Functions | |
| void | c_frequency_response (int n, int nfreq, const double *mass, int ldm, const double *stiff, int ldk, double alpha, double beta, const double *freq, const c_modal_excite frc, double *modes, double *modeshapes, int ldms, double complex *rsp, int ldr, void *user_data) |
| Compute a modal frequency response for a second-order system. | |
| void | c_dynamic_stiffness_dense (int n, double omega, const double *mass, int ldm, const double *damp, int ldc, const double *stiff, int ldk, double complex *dyn_stiff, int ldd) |
| Compute dense dynamic stiffness, K - omega^2 M + i omega C. | |
| void | c_frf_general_damp_1 (int n, int nfreq, const double *mass, int ldm, const double *damp, int ldc, const double *stiff, int ldk, const double *freq, const c_modal_excite frc, double complex *rsp, int ldr, int *ranks, void *user_data) |
| Compute a general-damping frequency response at explicit frequencies. | |
| void | c_frf_general_damp_2 (int n, int nfreq, double freq1, double freq2, const double *mass, int ldm, const double *damp, int ldc, const double *stiff, int ldk, const c_modal_excite frc, double complex *rsp, int ldr, int *ranks, void *user_data) |
| Compute a general-damping frequency response over an evenly spaced interval. | |
| double | c_compute_modal_damping (double lambda, double alpha, double beta) |
| Compute modal damping from Rayleigh coefficients. | |
| double | c_chirp (double t, double amp, double span, double f1Hz, double f2Hz) |
| Evaluate a swept-frequency chirp signal. | |
| void | c_modal_response (int n, const double *mass, int ldm, const double *stiff, int ldk, double *freqs, double *modeshapes, int ldms) |
| Compute modal frequencies and mass-normalized mode shapes. | |
| void | c_normalize_mode_shapes (int n, double *x, int ldx) |
| Normalize mode-shape columns. | |
| void | c_frf_sweep (int n, int nfreq, c_harmonic_ode fcn, const double *freq, const double *iv, int solver, double complex *rsp, int ldr, const c_frequency_sweep_controls *opts, void *user_data) |
| Perform a nonlinear harmonic frequency sweep. | |
| void | c_set_frequency_sweep_defaults (c_frequency_sweep_controls *x) |
| Fill frequency-sweep controls with defaults. | |
| void | c_evaluate_accelerance_frf_model (int n, int norder, const double *mdl, const double *omega, double complex *h) |
| Evaluate an accelerance rational FRF model. | |
| void | c_evaluate_receptance_frf_model (int n, int norder, const double *mdl, const double *omega, double complex *h) |
| Evaluate a receptance rational FRF model. | |
| void | c_set_iteration_controls_defaults (c_iteration_controls *x) |
| Fill nonlinear iteration controls with defaults. | |
| void | c_fit_frf (int n, int norder, int method, const double *freq, const double complex *rsp, const double *maxp, const double *minp, const c_iteration_controls *controls, double *mdl, c_regression_statistics *stats) |
| Fit an FRF model to measured data. | |
| void | c_siso_frequency_response (int n, int nf, const double *x, const double *y, double fs, int winsize, c_window_function winfun, int method, double *freq, double complex *rsp, void *user_data) |
| Estimate a SISO frequency response from input and output records. | |
| void | c_cross_product (const double x[3], const double y[3], double z[3]) |
| Compute the cross product of two three-vectors. | |
| void | c_to_skew_symmetric (const double x[3], double *y, int ldy) |
| Form a skew-symmetric matrix from a three-vector. | |
| double | c_vector_angle (const double x[3], const double y[3]) |
| Compute the angle between two vectors. | |
| double | c_scalar_projection (const double x[3], const double y[3]) |
| Compute the scalar projection of one vector onto another. | |
| void | c_vector_projection (const double x[3], const double y[3], double z[3]) |
| Project one vector onto another. | |
| double | c_vector_magnitude (int n, const double *x) |
| Compute a vector magnitude. | |
| void | c_vector_normalize (int n, double *x) |
| Normalize a vector in place. | |
| double | c_dot_product (int n, const double *x, const double *y) |
| Compute a dot product. | |
| bool | c_is_symmetric (int m, int n, const double *a, int lda) |
| Test whether a matrix is symmetric to within a small relative tolerance. | |
| void | c_siso_model_fit_least_squares (int nsets, int nparams, int neqns, const c_ode_fit fcn, const c_dynamic_system_measurement *x, const double *ic, double *p, int integrator, int ind, const double *maxp, const double *minp, const c_iteration_controls *controls, const c_lm_solver_options *opts, int nconstraints, const double *xc, const double *yc, const c_constraint_equations constraints, int nweights, const double *weights, c_regression_statistics *stats, c_iteration_behavior *info, void *user_data) |
| Fit an ODE model to dynamic-system measurements by constrained least squares. | |
| void | c_set_lm_solver_options_defaults (c_lm_solver_options *x) |
| Fill Levenberg-Marquardt options with defaults. | |
| int | c_alloc_dynamic_system_measurement (int n, c_dynamic_system_measurement *x) |
| Allocate one dynamic-system measurement record. | |
| void | c_free_dynamic_system_measurement (c_dynamic_system_measurement *x) |
| Release one dynamic-system measurement record. | |
| c_dynamic_system_measurement * | c_alloc_dynamic_system_measurement_array (int n, const int *ptsper) |
| Allocate an array of measurement records. | |
| void | c_free_dynamic_system_measurement_array (int n, c_dynamic_system_measurement *x) |
| Release an array of measurement records. | |
| void c_frequency_response | ( | int | n, |
| int | nfreq, | ||
| const double * | mass, | ||
| int | ldm, | ||
| const double * | stiff, | ||
| int | ldk, | ||
| double | alpha, | ||
| double | beta, | ||
| const double * | freq, | ||
| const c_modal_excite | frc, | ||
| double * | modes, | ||
| double * | modeshapes, | ||
| int | ldms, | ||
| double complex * | rsp, | ||
| int | ldr, | ||
| void * | user_data | ||
| ) |
Compute a modal frequency response for a second-order system.
| n | System order. |
| nfreq | Frequency count. |
| mass | Mass matrix. |
| ldm | Leading dimension of mass. |
| stiff | Stiffness matrix. |
| ldk | Leading dimension of stiff. |
| alpha | Mass-proportional damping coefficient. |
| beta | Stiffness-proportional damping coefficient. |
| freq | Frequencies. |
| frc | Modal force callback. |
| modes | Output modal frequencies. |
| modeshapes | Output mode shapes. |
| ldms | Leading dimension of modeshapes. |
| rsp | Output complex response. |
| ldr | Leading dimension of rsp. |
| user_data | Opaque caller data forwarded to frc. |
| void c_dynamic_stiffness_dense | ( | int | n, |
| double | omega, | ||
| const double * | mass, | ||
| int | ldm, | ||
| const double * | damp, | ||
| int | ldc, | ||
| const double * | stiff, | ||
| int | ldk, | ||
| double complex * | dyn_stiff, | ||
| int | ldd | ||
| ) |
Compute dense dynamic stiffness, K - omega^2 M + i omega C.
Matrices use column-major storage.
| n | Matrix order. |
| omega | Excitation frequency in radians per second. |
| mass | Mass matrix. |
| ldm | Leading dimension of mass. |
| damp | General damping matrix. |
| ldc | Leading dimension of damp. |
| stiff | Stiffness matrix. |
| ldk | Leading dimension of stiff. |
| dyn_stiff | Output complex dynamic stiffness matrix. |
| ldd | Leading dimension of dyn_stiff. |
| void c_frf_general_damp_1 | ( | int | n, |
| int | nfreq, | ||
| const double * | mass, | ||
| int | ldm, | ||
| const double * | damp, | ||
| int | ldc, | ||
| const double * | stiff, | ||
| int | ldk, | ||
| const double * | freq, | ||
| const c_modal_excite | frc, | ||
| double complex * | rsp, | ||
| int | ldr, | ||
| int * | ranks, | ||
| void * | user_data | ||
| ) |
Compute a general-damping frequency response at explicit frequencies.
Matrices and response use column-major storage.
| n | System order. |
| nfreq | Frequency count. |
| mass | Mass matrix. |
| ldm | Leading dimension of mass. |
| damp | General damping matrix. |
| ldc | Leading dimension of damp. |
| stiff | Stiffness matrix. |
| ldk | Leading dimension of stiff. |
| freq | Frequencies in radians per second. |
| frc | Force callback. |
| rsp | Output complex response matrix. |
| ldr | Leading dimension of rsp. |
| ranks | Output rank of each dynamic stiffness matrix. |
| user_data | Opaque caller data forwarded to frc. |
| void c_frf_general_damp_2 | ( | int | n, |
| int | nfreq, | ||
| double | freq1, | ||
| double | freq2, | ||
| const double * | mass, | ||
| int | ldm, | ||
| const double * | damp, | ||
| int | ldc, | ||
| const double * | stiff, | ||
| int | ldk, | ||
| const c_modal_excite | frc, | ||
| double complex * | rsp, | ||
| int | ldr, | ||
| int * | ranks, | ||
| void * | user_data | ||
| ) |
Compute a general-damping frequency response over an evenly spaced interval.
Matrices and response use column-major storage.
| n | System order. |
| nfreq | Frequency count, at least 2. |
| freq1 | Starting frequency in radians per second. |
| freq2 | Ending frequency in radians per second. |
| mass | Mass matrix. |
| ldm | Leading dimension of mass. |
| damp | General damping matrix. |
| ldc | Leading dimension of damp. |
| stiff | Stiffness matrix. |
| ldk | Leading dimension of stiff. |
| frc | Force callback. |
| rsp | Output complex response matrix. |
| ldr | Leading dimension of rsp. |
| ranks | Output rank of each dynamic stiffness matrix. |
| user_data | Opaque caller data forwarded to frc. |
| double c_compute_modal_damping | ( | double | lambda, |
| double | alpha, | ||
| double | beta | ||
| ) |
Compute modal damping from Rayleigh coefficients.
| lambda | Modal eigenvalue. |
| alpha | Mass-proportional coefficient. |
| beta | Stiffness-proportional coefficient. |
| double c_chirp | ( | double | t, |
| double | amp, | ||
| double | span, | ||
| double | f1Hz, | ||
| double | f2Hz | ||
| ) |
Evaluate a swept-frequency chirp signal.
| t | Time. |
| amp | Amplitude. |
| span | Sweep span. |
| f1Hz | Initial frequency in hertz. |
| f2Hz | Final frequency in hertz. |
| void c_modal_response | ( | int | n, |
| const double * | mass, | ||
| int | ldm, | ||
| const double * | stiff, | ||
| int | ldk, | ||
| double * | freqs, | ||
| double * | modeshapes, | ||
| int | ldms | ||
| ) |
Compute modal frequencies and mass-normalized mode shapes.
| n | System order. |
| mass | Mass matrix. |
| ldm | Leading dimension of mass. |
| stiff | Stiffness matrix. |
| ldk | Leading dimension of stiff. |
| freqs | Output modal frequencies. |
| modeshapes | Output mode shapes. |
| ldms | Leading dimension of modeshapes. |
| void c_normalize_mode_shapes | ( | int | n, |
| double * | x, | ||
| int | ldx | ||
| ) |
Normalize mode-shape columns.
| n | Number of rows or modes. |
| x | Mode-shape matrix, updated in place. |
| ldx | Leading dimension of x. |
| void c_frf_sweep | ( | int | n, |
| int | nfreq, | ||
| c_harmonic_ode | fcn, | ||
| const double * | freq, | ||
| const double * | iv, | ||
| int | solver, | ||
| double complex * | rsp, | ||
| int | ldr, | ||
| const c_frequency_sweep_controls * | opts, | ||
| void * | user_data | ||
| ) |
Perform a nonlinear harmonic frequency sweep.
| n | State dimension. |
| nfreq | Frequency count. |
| fcn | Harmonic ODE callback. |
| freq | Frequencies. |
| iv | Initial values. |
| solver | Integration method. |
| rsp | Output complex response. |
| ldr | Leading dimension of rsp. |
| opts | Sweep controls. |
| user_data | Opaque caller data forwarded to fcn. |
| void c_set_frequency_sweep_defaults | ( | c_frequency_sweep_controls * | x | ) |
Fill frequency-sweep controls with defaults.
| x | Controls updated in place. |
| void c_evaluate_accelerance_frf_model | ( | int | n, |
| int | norder, | ||
| const double * | mdl, | ||
| const double * | omega, | ||
| double complex * | h | ||
| ) |
Evaluate an accelerance rational FRF model.
| n | Frequency count. |
| norder | Model order. |
| mdl | Model coefficients. |
| omega | Angular frequencies. |
| h | Output complex FRF values. |
| void c_evaluate_receptance_frf_model | ( | int | n, |
| int | norder, | ||
| const double * | mdl, | ||
| const double * | omega, | ||
| double complex * | h | ||
| ) |
Evaluate a receptance rational FRF model.
| n | Frequency count. |
| norder | Model order. |
| mdl | Model coefficients. |
| omega | Angular frequencies. |
| h | Output complex FRF values. |
| void c_set_iteration_controls_defaults | ( | c_iteration_controls * | x | ) |
Fill nonlinear iteration controls with defaults.
| x | Controls updated in place. |
| void c_fit_frf | ( | int | n, |
| int | norder, | ||
| int | method, | ||
| const double * | freq, | ||
| const double complex * | rsp, | ||
| const double * | maxp, | ||
| const double * | minp, | ||
| const c_iteration_controls * | controls, | ||
| double * | mdl, | ||
| c_regression_statistics * | stats | ||
| ) |
Fit an FRF model to measured data.
| n | Data count. |
| norder | Model order. |
| method | Model or update method. |
| freq | Frequencies. |
| rsp | Measured complex response. |
| maxp | Parameter upper bounds. |
| minp | Parameter lower bounds. |
| controls | Iteration controls. |
| mdl | Output fitted parameters. |
| stats | Output regression statistics. |
| void c_siso_frequency_response | ( | int | n, |
| int | nf, | ||
| const double * | x, | ||
| const double * | y, | ||
| double | fs, | ||
| int | winsize, | ||
| c_window_function | winfun, | ||
| int | method, | ||
| double * | freq, | ||
| double complex * | rsp, | ||
| void * | user_data | ||
| ) |
Estimate a SISO frequency response from input and output records.
| n | Sample count. |
| nf | Frequency-bin count. |
| x | Input samples. |
| y | Output samples. |
| fs | Sampling frequency. |
| winsize | Window size. |
| winfun | Window callback. |
| method | H1 or H2 estimator. |
| freq | Output frequencies. |
| rsp | Output complex response. |
| user_data | Opaque caller data forwarded to winfun. |
| void c_cross_product | ( | const double | x[3], |
| const double | y[3], | ||
| double | z[3] | ||
| ) |
Compute the cross product of two three-vectors.
| x | First vector. |
| y | Second vector. |
| z | Output vector. |
| void c_to_skew_symmetric | ( | const double | x[3], |
| double * | y, | ||
| int | ldy | ||
| ) |
Form a skew-symmetric matrix from a three-vector.
| x | Input vector. |
| y | Output matrix. |
| ldy | Leading dimension of y. |
| double c_vector_angle | ( | const double | x[3], |
| const double | y[3] | ||
| ) |
Compute the angle between two vectors.
| x | First vector. |
| y | Second vector. |
| double c_scalar_projection | ( | const double | x[3], |
| const double | y[3] | ||
| ) |
Compute the scalar projection of one vector onto another.
| x | Vector being projected. |
| y | Reference vector. |
| void c_vector_projection | ( | const double | x[3], |
| const double | y[3], | ||
| double | z[3] | ||
| ) |
Project one vector onto another.
| x | Vector being projected. |
| y | Reference vector. |
| z | Output projection. |
| double c_vector_magnitude | ( | int | n, |
| const double * | x | ||
| ) |
Compute a vector magnitude.
| n | Vector length. |
| x | Vector. |
| void c_vector_normalize | ( | int | n, |
| double * | x | ||
| ) |
Normalize a vector in place.
| n | Vector length. |
| x | Vector updated in place. |
| double c_dot_product | ( | int | n, |
| const double * | x, | ||
| const double * | y | ||
| ) |
Compute a dot product.
| n | Vector length. |
| x | First vector. |
| y | Second vector. |
| bool c_is_symmetric | ( | int | m, |
| int | n, | ||
| const double * | a, | ||
| int | lda | ||
| ) |
Test whether a matrix is symmetric to within a small relative tolerance.
| m | Row count. |
| n | Column count. |
| a | m-by-n matrix. |
| lda | Leading dimension of a. |
| void c_siso_model_fit_least_squares | ( | int | nsets, |
| int | nparams, | ||
| int | neqns, | ||
| const c_ode_fit | fcn, | ||
| const c_dynamic_system_measurement * | x, | ||
| const double * | ic, | ||
| double * | p, | ||
| int | integrator, | ||
| int | ind, | ||
| const double * | maxp, | ||
| const double * | minp, | ||
| const c_iteration_controls * | controls, | ||
| const c_lm_solver_options * | opts, | ||
| int | nconstraints, | ||
| const double * | xc, | ||
| const double * | yc, | ||
| const c_constraint_equations | constraints, | ||
| int | nweights, | ||
| const double * | weights, | ||
| c_regression_statistics * | stats, | ||
| c_iteration_behavior * | info, | ||
| void * | user_data | ||
| ) |
Fit an ODE model to dynamic-system measurements by constrained least squares.
| nsets | Number of measurement sets. |
| nparams | Number of parameters. |
| neqns | Number of model equations. |
| fcn | ODE callback. |
| x | Measurement records. |
| ic | Initial conditions. |
| p | Parameters, updated in place. |
| integrator | ODE integration method. |
| ind | Integration direction or index. |
| maxp | Upper parameter bounds. |
| minp | Lower parameter bounds. |
| controls | Iteration controls. |
| opts | Levenberg-Marquardt options. |
| nconstraints | Constraint count. |
| xc | Constraint inputs. |
| yc | Constraint outputs. |
| constraints | Constraint callback. |
| nweights | Weight count. |
| weights | Residual weights. |
| stats | Output regression statistics. |
| info | Output iteration statistics. |
| user_data | Opaque caller data forwarded to fcn and constraints. |
| void c_set_lm_solver_options_defaults | ( | c_lm_solver_options * | x | ) |
Fill Levenberg-Marquardt options with defaults.
| x | Options updated in place. |
| int c_alloc_dynamic_system_measurement | ( | int | n, |
| c_dynamic_system_measurement * | x | ||
| ) |
Allocate one dynamic-system measurement record.
| n | Sample count. |
| x | Record initialized by the routine. |
| void c_free_dynamic_system_measurement | ( | c_dynamic_system_measurement * | x | ) |
Release one dynamic-system measurement record.
| x | Record to release. |
| c_dynamic_system_measurement * c_alloc_dynamic_system_measurement_array | ( | int | n, |
| const int * | ptsper | ||
| ) |
Allocate an array of measurement records.
| n | Number of records. |
| ptsper | Samples per record. |
| void c_free_dynamic_system_measurement_array | ( | int | n, |
| c_dynamic_system_measurement * | x | ||
| ) |
Release an array of measurement records.
| n | Number of records. |
| x | Array to release. |