Global Namespace

Overview

// typedefs

typedef struct s2_damper_t s2_damper_t
typedef struct s2_forcemodule_t s2_forcemodule_t
typedef struct s2_pid_t s2_pid_t
typedef struct s2_spring_t s2_spring_t
typedef struct s2_numericalintegrator_ode113_t s2_numericalintegrator_ode113_t
typedef struct s2_numericalintegrator_ode113b_t s2_numericalintegrator_ode113b_t

// enums

enum s2_forcemodule_enum_t
enum s2_numericalintegrator_enum_t
enum s2_pid_io_enum_t
enum s2_pid_target_enum_t
enum s2_spring_enum_t

// structs

struct aligning_coefficients
struct bessel
struct combinedLatCoefs
struct combinedLongCoefs
struct combinedTorqueCoefs
struct dimension
struct inclination_angle_range
struct lateral_coefficients
struct long_slip_range
struct longitudinal_coefficients
struct model
struct overturning_coefficients
struct pureLatCoefs
struct pureLongCoefs
struct pureTorqueCoefs
struct relaxationL
struct rolling_coefficients
struct s2_damper_t
struct s2_forcemodule_t
struct s2_numericalintegrator_ode113_t
struct s2_numericalintegrator_ode113b_t
struct s2_pid_t
struct s2_spring_t
struct s2_tire_fiala_t
struct s2_tire_pac2002_t
struct scaling_coefficients
struct shape
struct slip_angle_range
struct slips
struct thresholds
struct vertical
struct vertical_force_range
struct zetaCoefs

// global functions

void
s2_context_basicSweep (s2_context_t*)

void
s2_context_sweepAndPrune (s2_context_t*)

void
s2_context_contactDetection (s2_context_t*)

void
s2_damping_joint (
    s2_context_t* context,
    s2_joint_t* joint
    )

s2_tire_fiala_t*
s2_tire_fiala (
    s2_context_t* context,
    const char* filePath,
    s2_stackstr_t* wheelBody
    )

void
s2_tire_fiala_free (s2_tire_fiala_t* tire)

void
s2_tire_fiala_update (
    s2_context_t* context,
    void** parameters,
    double* y
    )

void
s2_tire_fiala_loadTireDataFile (
    s2_context_t* context,
    s2_tire_fiala_t* tire,
    const char* filePath
    )

s2_tire_fiala_t*
s2_tire_fiala (
    s2_context_t* context,
    const char* filePath,
    s2_stackstr_t* wheelBody
    )

void
s2_tire_fiala_free (s2_tire_fiala_t* tire)

void
s2_tire_fiala_update (
    s2_context_t* context,
    void** parameters,
    double* y
    )

void
s2_tire_fiala_loadTireDataFile (
    s2_context_t* context,
    s2_tire_fiala_t* tire,
    const char* filePath
    )

s2_forcemodule_t*
s2_forcemodule (s2_forcemodule_enum_t)

void
s2_context_flattenForceModules (s2_context_t*)

void
s2_context_connectForceModules (s2_context_t*)

void
s2_context_updateTransientForceModules (
    s2_context_t*,
    double*
    )

void
s2_context_saveForceModuleHistory (s2_context_t* context)

void
s2_forcemodule_append (
    s2_assembly_t* assembly,
    s2_forcemodule_t* forceModule
    )

void
s2_forcemodule_free (s2_forcemodule_t*)

void
s2_forcemodule_load (
    s2_context_t* context,
    s2_assembly_t* assembly,
    s2_stackstr_t* prefix,
    json_t* forceModuleObject
    )

s2_tire_pac2002_t*
s2_tire_pac2002 (
    s2_context_t* context,
    const char* filePath,
    s2_stackstr_t* wheelBody,
    bool useTransientSlip
    )

void
s2_tire_pac2002_free (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_update (
    s2_context_t* context,
    void** parameters,
    double* y
    )

void
s2_tire_pac2002_getSlipAngle (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_loadTireDataFile (
    s2_context_t* context,
    s2_tire_pac2002_t* tire,
    const char* filePath
    )

void
s2_tire_pac2002_updateWFrame (s2_tire_pac2002_t* tire)

double
s2_tire_pac2002_calc_Fz (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_updateRelaxationLengths (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_updateSlipKinematic (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_zeroSlips (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_evaluateSlips (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_evaluateReactions (
    s2_tire_pac2002_t* tire,
    bool write_violations,
    bool enforce_threshold
    )

void
s2_tire_pac2002_slip_from_uv (
    s2_tire_pac2002_t* tire,
    bool use_besselink,
    double bessel_Cx,
    double bessel_Cy,
    double V_low
    )

void
s2_tire_pac2002_pureSlipReactions (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_combinedSlipReactions (s2_tire_pac2002_t* tire)

double
s2_tire_pac2002_Fx_pureLong (
    s2_tire_pac2002_t* tire,
    double gamma,
    double kappa
    )

double
s2_tire_pac2002_Fy_pureLat (
    s2_tire_pac2002_t* tire,
    double alpha,
    double gamma
    )

double
s2_tire_pac2002_Mz_pureLat (
    s2_tire_pac2002_t* tire,
    double alpha,
    double gamma,
    double Fy_pureSlip
    )

double
s2_tire_pac2002_Fx_combined (
    s2_tire_pac2002_t* tire,
    double alpha,
    double gamma,
    double kappa,
    double Fx_pureSlip
    )

double
s2_tire_pac2002_Fy_combined (
    s2_tire_pac2002_t* tire,
    double alpha,
    double gamma,
    double kappa,
    double Fy_pureSlip
    )

double
s2_tire_pac2002_Mz_combined (
    s2_tire_pac2002_t* tire,
    double alpha_r,
    double alpha_t,
    double gamma,
    double kappa,
    double Fx_combined,
    double Fy_combined
    )

double
s2_tire_pac2002_calc_Mx (
    s2_tire_pac2002_t* tire,
    double gamma,
    double Fy_combined
    )

double
s2_tire_pac2002_calc_My (
    s2_tire_pac2002_t* tire,
    double Fx_combined
    )

bool
s2_tire_pac2002_discTerrainContact (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_updateTransient (
    s2_context_t* context,
    void** parameters,
    double* y
    )

void
s2_tire_pac2002_updateVerticalLoad (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_transferForces (
    s2_context_t* context,
    s2_tire_pac2002_t* tire
    )

s2_tire_pac2002_t*
s2_tire_pac2002 (
    s2_context_t* context,
    const char* filePath,
    s2_stackstr_t* wheelBody,
    bool useTransientSlip
    )

void
s2_tire_pac2002_free (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_update (
    s2_context_t* context,
    void** parameters,
    double* y
    )

void
s2_tire_pac2002_getSlipAngle (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_loadTireDataFile (
    s2_context_t* context,
    s2_tire_pac2002_t* tire,
    const char* filePath
    )

void
s2_tire_pac2002_updateWFrame (s2_tire_pac2002_t* tire)

double
s2_tire_pac2002_calc_Fz (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_updateRelaxationLengths (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_updateSlipKinematic (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_zeroSlips (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_evaluateSlips (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_evaluateReactions (
    s2_tire_pac2002_t* tire,
    bool write_violations,
    bool enforce_threshold
    )

void
s2_tire_pac2002_slip_from_uv (
    s2_tire_pac2002_t* tire,
    bool use_besselink,
    double bessel_Cx,
    double bessel_Cy,
    double V_low
    )

void
s2_tire_pac2002_pureSlipReactions (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_combinedSlipReactions (s2_tire_pac2002_t* tire)

double
s2_tire_pac2002_Fx_pureLong (
    s2_tire_pac2002_t* tire,
    double gamma,
    double kappa
    )

double
s2_tire_pac2002_Fy_pureLat (
    s2_tire_pac2002_t* tire,
    double alpha,
    double gamma
    )

double
s2_tire_pac2002_Mz_pureLat (
    s2_tire_pac2002_t* tire,
    double alpha,
    double gamma,
    double Fy_pureSlip
    )

double
s2_tire_pac2002_Fx_combined (
    s2_tire_pac2002_t* tire,
    double alpha,
    double gamma,
    double kappa,
    double Fx_pureSlip
    )

double
s2_tire_pac2002_Fy_combined (
    s2_tire_pac2002_t* tire,
    double alpha,
    double gamma,
    double kappa,
    double Fy_pureSlip
    )

double
s2_tire_pac2002_Mz_combined (
    s2_tire_pac2002_t* tire,
    double alpha_r,
    double alpha_t,
    double gamma,
    double kappa,
    double Fx_combined,
    double Fy_combined
    )

double
s2_tire_pac2002_calc_Mx (
    s2_tire_pac2002_t* tire,
    double gamma,
    double Fy_combined
    )

double
s2_tire_pac2002_calc_My (
    s2_tire_pac2002_t* tire,
    double Fx_combined
    )

bool
s2_tire_pac2002_discTerrainContact (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_updateTransient (
    s2_context_t* context,
    void** parameters,
    double* y
    )

void
s2_tire_pac2002_updateVerticalLoad (s2_tire_pac2002_t* tire)

void
s2_tire_pac2002_transferForces (
    s2_context_t* context,
    s2_tire_pac2002_t* tire
    )

s2_pid_t*
s2_pid ()

void
s2_pid_updateFromJointToJoint (
    s2_context_t* context,
    void** parameters,
    double* y
    )

void
s2_pid_updateFromFrameToJoint (
    s2_context_t* context,
    void** parameters,
    double* y
    )

void
s2_pid_connectForceModulePointer (
    s2_forcemodule_t* forceModule,
    s2_pid_t* pid
    )

void
s2_pid_saveHistory (void* parameters)

void
s2_context_setForces (
    s2_context_t*,
    double*
    )

void
s2_stiffness_joint (
    s2_context_t* context,
    s2_joint_t* joint
    )

void
s2_context_allocNumericalIntegrator (s2_context_t* context)

void
s2_context_freeNumericalIntegrator (s2_context_t* context)

void
s2_ode113 (
    void  f double t, double y[], double dy[], s2_context_t *context,
    s2_context_t* context
    )

void
s2_ode113_de (
    void  f double t, double y[], double dy[], s2_context_t *context,
    s2_context_t* context,
    int neqn,
    double y [],
    double* t,
    double tout,
    double relerr,
    double abserr,
    int* iflag,
    double yy [],
    double wt [],
    double p [],
    double yp [],
    double ypout [],
    double phi [],
    double alpha [],
    double beta [],
    double sig [],
    double v [],
    double w [],
    double g [],
    int* phase1,
    double psi [],
    double* x,
    double* h,
    double* hold,
    int* start,
    double* told,
    double* delsgn,
    int* ns,
    int* nornd,
    int* k,
    int* kold,
    int* isnold
    )

int
i4_sign (int i)

void
s2_ode113_intrp (
    double x,
    double y [],
    double xout,
    double yout [],
    double ypout [],
    int neqn,
    int kold,
    double phi [],
    double psi []
    )

double
r8_epsilon (void)

void
s2_ode113_step (
    double* x,
    double y [],
    void  f double t, double y[], double dy[], s2_context_t *context,
    s2_context_t* context,
    int neqn,
    double* h,
    double* eps,
    double wt [],
    int* start,
    double* hold,
    int* k,
    int* kold,
    int* crash,
    double phi [],
    double p [],
    double yp [],
    double psi [],
    double alpha [],
    double beta [],
    double sig [],
    double v [],
    double w [],
    double g [],
    int* phase1,
    int* ns,
    int* nornd
    )

void
timestamp (void)

void
s2_context_allocOde113 (s2_context_t* context)

void
s2_context_freeOde113 (s2_context_t* context)

void
s2_context_integrateEquationsOde113 (s2_context_t* context)

void
s2_context_allocOde113b (s2_context_t*)

void
s2_context_freeOde113b (s2_context_t*)

void
s2_ode113b_fcn (
    double y [],
    s2_context_t*
    )

void
s2_ode113b_step (
    void  f double y[], s2_context_t *context,
    s2_context_t* context
    )

void
s2_ode113b_de (
    void  f double y[], s2_context_t *context,
    s2_context_t* context
    )

void
s2_context_integrateEquationsOde113b (s2_context_t* context)

// macros

#define _SHIFT_H_

Detailed Documentation

Typedefs

typedef struct s2_damper_t s2_damper_t

damper data structure

piecewise curves (i.e. splines) are not currently supported

typedef struct s2_forcemodule_t s2_forcemodule_t

utility to feed back forces into a running simulation

typedef struct s2_pid_t s2_pid_t

initially set up to apply a force in a joint

typedef struct s2_spring_t s2_spring_t

spring data structure

piecewise curves (i.e. splines) are not currently supported

typedef struct s2_numericalintegrator_ode113_t s2_numericalintegrator_ode113_t

Attributes associated with numerical integrator.

typedef struct s2_numericalintegrator_ode113b_t s2_numericalintegrator_ode113b_t

Attributes associated with numerical integrator.

Global Functions

void
s2_context_basicSweep (s2_context_t*)

sets up a basic “sweep” operation to identify 1/2 n^2 potential collisions. This basic sweep function need only be called once at initial setup and will set up simplices to test each collision object with every other collision object. No pruning is performed here which would reduce unnecessary computation.

void
s2_context_sweepAndPrune (s2_context_t*)

performs initial sweep and prune pass to identify potentially contacting bodies in scene

void
s2_context_contactDetection (s2_context_t*)

perform contact detection for potentially contacting bodies identified in sweep and prune pass

s2_tire_fiala_t*
s2_tire_fiala (
    s2_context_t* context,
    const char* filePath,
    s2_stackstr_t* wheelBody
    )

allocate memory for tire with default parameters

void
s2_tire_fiala_free (s2_tire_fiala_t* tire)

free memory for s2_tire_fiala_t

void
s2_tire_fiala_update (
    s2_context_t* context,
    void** parameters,
    double* y
    )

placeholder function to update transient properties associated with fiala tire

void
s2_tire_fiala_loadTireDataFile (
    s2_context_t* context,
    s2_tire_fiala_t* tire,
    const char* filePath
    )

Load a .tir tire specification file.

s2_tire_fiala_t*
s2_tire_fiala (
    s2_context_t* context,
    const char* filePath,
    s2_stackstr_t* wheelBody
    )

allocate memory for tire with default parameters

void
s2_tire_fiala_free (s2_tire_fiala_t* tire)

free memory for s2_tire_fiala_t

void
s2_tire_fiala_update (
    s2_context_t* context,
    void** parameters,
    double* y
    )

placeholder function to update transient properties associated with fiala tire

void
s2_tire_fiala_loadTireDataFile (
    s2_context_t* context,
    s2_tire_fiala_t* tire,
    const char* filePath
    )

Load a .tir tire specification file.

s2_forcemodule_t*
s2_forcemodule (s2_forcemodule_enum_t)

initialize a forcemodule data structure

void
s2_context_flattenForceModules (s2_context_t*)

flatten force modules into array of array of pointers to force modules with static and transient properties

void
s2_context_connectForceModules (s2_context_t*)

connect force module dy array pointer and set yOffset, called after numerical integrator set up

void
s2_context_saveForceModuleHistory (s2_context_t* context)

save time histories of force modules

ode113 does not integrate equations in monotonically time increasing order, any values that need to be saved are set in this function and called in a different location when integrating the equations only when convergence is true

void
s2_forcemodule_append (
    s2_assembly_t* assembly,
    s2_forcemodule_t* forceModule
    )

Append a force module to an Assembly datastructure.

Parameters:

assembly an Assembly datastructure to append to
forcemodule a force module datastructure to append
void
s2_forcemodule_free (s2_forcemodule_t*)

initialize a forcemodule data structure

void
s2_forcemodule_load (
    s2_context_t* context,
    s2_assembly_t* assembly,
    s2_stackstr_t* prefix,
    json_t* forceModuleObject
    )

load forcemodule properties from json file

s2_tire_pac2002_t*
s2_tire_pac2002 (
    s2_context_t* context,
    const char* filePath,
    s2_stackstr_t* wheelBody,
    bool useTransientSlip
    )

allocate memory for tire with default parameters

void
s2_tire_pac2002_free (s2_tire_pac2002_t* tire)

free memory for s2_tire_pac2002_t

void
s2_tire_pac2002_update (
    s2_context_t* context,
    void** parameters,
    double* y
    )

update slip angle, longtitudinal slip and camber angle, update forces to model

void
s2_tire_pac2002_loadTireDataFile (
    s2_context_t* context,
    s2_tire_pac2002_t* tire,
    const char* filePath
    )

Load a .tir tire specification file.

void
s2_tire_pac2002_updateWFrame (s2_tire_pac2002_t* tire)

updates wFrame, wheel normal (in iso convention), terrain normal,

double
s2_tire_pac2002_calc_Fz (s2_tire_pac2002_t* tire)

calculate Fz using spring - damper model

void
s2_tire_pac2002_updateRelaxationLengths (s2_tire_pac2002_t* tire)

compute relaxation lengths

void
s2_tire_pac2002_updateSlipKinematic (s2_tire_pac2002_t* tire)

Calculate kinematic slip quantities from the current wheel state.

Note: when not in contact, all slips are assumed zero, but velocities still set

void
s2_tire_pac2002_zeroSlips (s2_tire_pac2002_t* tire)

set the tire m_slip vector to all zeros

void
s2_tire_pac2002_evaluateReactions (
    s2_tire_pac2002_t* tire,
    bool write_violations,
    bool enforce_threshold
    )

after calculating reactions, enforce limits when forces/moments exceed specified thresholds (except on Fz)

void
s2_tire_pac2002_slip_from_uv (
    s2_tire_pac2002_t* tire,
    bool use_besselink,
    double bessel_Cx,
    double bessel_Cy,
    double V_low
    )

calculate and set the transient slip values (kappaP, alphaP, gammaP) from u, v deflections. optionally turn on/off besselink low velocity damping

void
s2_tire_pac2002_pureSlipReactions (s2_tire_pac2002_t* tire)

Calculate tire reactions.

pure slip reactions, if the tire is in contact with the ground, in the TYDEX W-Axis system. calcFx alphaP ~= 0 calcFy and calcMz kappaP ~= 0 NOTE: alphaP, gammaP and kappaP defined with respect to tire side specified from .tir input file. e.g., positive alpha = turn wheel toward vehicle centerline e.g., positive gamma = wheel vertical axis top pointing toward vehicle center

void
s2_tire_pac2002_combinedSlipReactions (s2_tire_pac2002_t* tire)

calculate combined slip reactions combined slip reactions, if the tire is in contact with the ground MUST call pureSlipReactions() first, as these functions rely on intermediate values

NOTE: alphaP and gammaP have already been modified for being on the L/R side e.g., positive alpha = turn wheel toward vehicle centerline e.g., positive gamma = wheel vertical axis top pointing toward vehicle center

double
s2_tire_pac2002_Fx_pureLong (
    s2_tire_pac2002_t* tire,
    double gamma,
    double kappa
    )

longitudinal force, alpha ~= 0 assign to m_FM.force.x assign m_pureLong, trionometric function calculated constants

double
s2_tire_pac2002_Fy_pureLat (
    s2_tire_pac2002_t* tire,
    double alpha,
    double gamma
    )

lateral force, kappa ~= 0 assign to m_FM.force.y assign m_pureLong, trionometric function calculated constants

double
s2_tire_pac2002_Mz_pureLat (
    s2_tire_pac2002_t* tire,
    double alpha,
    double gamma,
    double Fy_pureSlip
    )

aligning moment, kappa ~= 0 assign to m_FM.moment.z assign m_pureLong, trigonometric function calculated constants

double
s2_tire_pac2002_Fx_combined (
    s2_tire_pac2002_t* tire,
    double alpha,
    double gamma,
    double kappa,
    double Fx_pureSlip
    )

longitudinal force, combined slip (general case) assign m_FM_combined.force.x assign m_combinedLong

double
s2_tire_pac2002_Fy_combined (
    s2_tire_pac2002_t* tire,
    double alpha,
    double gamma,
    double kappa,
    double Fy_pureSlip
    )

calculate lateral force, combined slip (general case) assign m_FM_combined.force.y assign m_combinedLat

double
s2_tire_pac2002_Mz_combined (
    s2_tire_pac2002_t* tire,
    double alpha_r,
    double alpha_t,
    double gamma,
    double kappa,
    double Fx_combined,
    double Fy_combined
    )

calculate aligning torque, combined slip (gernal case) assign m_FM_combined.moment.z assign m_combinedTorque

double
s2_tire_pac2002_calc_Mx (
    s2_tire_pac2002_t* tire,
    double gamma,
    double Fy_combined
    )

calculate the overturning couple moment assign m_FM.moment.x and m_FM_combined.moment.x

double
s2_tire_pac2002_calc_My (
    s2_tire_pac2002_t* tire,
    double Fx_combined
    )

calculate the rolling resistance moment, assign m_FM.moment.y and m_FM_combined.moment.y

bool
s2_tire_pac2002_discTerrainContact (s2_tire_pac2002_t* tire)

check for contact, set tire->inContact flag and set penetration depth

void
s2_tire_pac2002_updateVerticalLoad (s2_tire_pac2002_t* tire)

Calculate the tire vertical load at the current configuration and update the tire deflection and tire rolling radius.

void
s2_tire_pac2002_transferForces (
    s2_context_t* context,
    s2_tire_pac2002_t* tire
    )

wrapper function to update for use with force module data structure

s2_tire_pac2002_t*
s2_tire_pac2002 (
    s2_context_t* context,
    const char* filePath,
    s2_stackstr_t* wheelBody,
    bool useTransientSlip
    )

allocate memory for tire with default parameters

void
s2_tire_pac2002_free (s2_tire_pac2002_t* tire)

free memory for s2_tire_pac2002_t

void
s2_tire_pac2002_update (
    s2_context_t* context,
    void** parameters,
    double* y
    )

update slip angle, longtitudinal slip and camber angle, update forces to model

void
s2_tire_pac2002_loadTireDataFile (
    s2_context_t* context,
    s2_tire_pac2002_t* tire,
    const char* filePath
    )

Load a .tir tire specification file.

void
s2_tire_pac2002_updateWFrame (s2_tire_pac2002_t* tire)

updates wFrame, wheel normal (in iso convention), terrain normal,

double
s2_tire_pac2002_calc_Fz (s2_tire_pac2002_t* tire)

calculate Fz using spring - damper model

void
s2_tire_pac2002_updateRelaxationLengths (s2_tire_pac2002_t* tire)

compute relaxation lengths

void
s2_tire_pac2002_updateSlipKinematic (s2_tire_pac2002_t* tire)

Calculate kinematic slip quantities from the current wheel state.

Note: when not in contact, all slips are assumed zero, but velocities still set

void
s2_tire_pac2002_zeroSlips (s2_tire_pac2002_t* tire)

set the tire m_slip vector to all zeros

void
s2_tire_pac2002_evaluateReactions (
    s2_tire_pac2002_t* tire,
    bool write_violations,
    bool enforce_threshold
    )

after calculating reactions, enforce limits when forces/moments exceed specified thresholds (except on Fz)

void
s2_tire_pac2002_slip_from_uv (
    s2_tire_pac2002_t* tire,
    bool use_besselink,
    double bessel_Cx,
    double bessel_Cy,
    double V_low
    )

calculate and set the transient slip values (kappaP, alphaP, gammaP) from u, v deflections. optionally turn on/off besselink low velocity damping

void
s2_tire_pac2002_pureSlipReactions (s2_tire_pac2002_t* tire)

Calculate tire reactions.

pure slip reactions, if the tire is in contact with the ground, in the TYDEX W-Axis system. calcFx alphaP ~= 0 calcFy and calcMz kappaP ~= 0 NOTE: alphaP, gammaP and kappaP defined with respect to tire side specified from .tir input file. e.g., positive alpha = turn wheel toward vehicle centerline e.g., positive gamma = wheel vertical axis top pointing toward vehicle center

void
s2_tire_pac2002_combinedSlipReactions (s2_tire_pac2002_t* tire)

calculate combined slip reactions combined slip reactions, if the tire is in contact with the ground MUST call pureSlipReactions() first, as these functions rely on intermediate values

NOTE: alphaP and gammaP have already been modified for being on the L/R side e.g., positive alpha = turn wheel toward vehicle centerline e.g., positive gamma = wheel vertical axis top pointing toward vehicle center

double
s2_tire_pac2002_Fx_pureLong (
    s2_tire_pac2002_t* tire,
    double gamma,
    double kappa
    )

longitudinal force, alpha ~= 0 assign to m_FM.force.x assign m_pureLong, trionometric function calculated constants

double
s2_tire_pac2002_Fy_pureLat (
    s2_tire_pac2002_t* tire,
    double alpha,
    double gamma
    )

lateral force, kappa ~= 0 assign to m_FM.force.y assign m_pureLong, trionometric function calculated constants

double
s2_tire_pac2002_Mz_pureLat (
    s2_tire_pac2002_t* tire,
    double alpha,
    double gamma,
    double Fy_pureSlip
    )

aligning moment, kappa ~= 0 assign to m_FM.moment.z assign m_pureLong, trigonometric function calculated constants

double
s2_tire_pac2002_Fx_combined (
    s2_tire_pac2002_t* tire,
    double alpha,
    double gamma,
    double kappa,
    double Fx_pureSlip
    )

longitudinal force, combined slip (general case) assign m_FM_combined.force.x assign m_combinedLong

double
s2_tire_pac2002_Fy_combined (
    s2_tire_pac2002_t* tire,
    double alpha,
    double gamma,
    double kappa,
    double Fy_pureSlip
    )

calculate lateral force, combined slip (general case) assign m_FM_combined.force.y assign m_combinedLat

double
s2_tire_pac2002_Mz_combined (
    s2_tire_pac2002_t* tire,
    double alpha_r,
    double alpha_t,
    double gamma,
    double kappa,
    double Fx_combined,
    double Fy_combined
    )

calculate aligning torque, combined slip (gernal case) assign m_FM_combined.moment.z assign m_combinedTorque

double
s2_tire_pac2002_calc_Mx (
    s2_tire_pac2002_t* tire,
    double gamma,
    double Fy_combined
    )

calculate the overturning couple moment assign m_FM.moment.x and m_FM_combined.moment.x

double
s2_tire_pac2002_calc_My (
    s2_tire_pac2002_t* tire,
    double Fx_combined
    )

calculate the rolling resistance moment, assign m_FM.moment.y and m_FM_combined.moment.y

bool
s2_tire_pac2002_discTerrainContact (s2_tire_pac2002_t* tire)

check for contact, set tire->inContact flag and set penetration depth

void
s2_tire_pac2002_updateVerticalLoad (s2_tire_pac2002_t* tire)

Calculate the tire vertical load at the current configuration and update the tire deflection and tire rolling radius.

void
s2_tire_pac2002_transferForces (
    s2_context_t* context,
    s2_tire_pac2002_t* tire
    )

wrapper function to update for use with force module data structure

void
s2_pid_updateFromJointToJoint (
    s2_context_t* context,
    void** parameters,
    double* y
    )

update a force in a joint as a function of velocity in a given frame

void
s2_pid_updateFromFrameToJoint (
    s2_context_t* context,
    void** parameters,
    double* y
    )

update a force in a joint as a function of velocity in a given frame

void
s2_context_setForces (
    s2_context_t*,
    double*
    )

clear and set externally applied forces to model

void
s2_stiffness_joint (
    s2_context_t* context,
    s2_joint_t* joint
    )

sets stiffness within a joint

void
s2_context_allocNumericalIntegrator (s2_context_t* context)

Initialize and allocate memory for numericalIntegrator datastructure.

Returns:

a numericalIntegrator datastructure

void
s2_context_freeNumericalIntegrator (s2_context_t* context)

Free memory for numericalintegrator datastructure.

Parameters:

numericalIntegrator a numerical integrator datastructure
int
i4_sign (int i)

i4 returns the sign of an I4.

Licensing:

This code is distributed under the GNU LGPL license.

Modified:

23 October 2007

Author:

John Burkardt

Parameters:

Input, int I, the integer whose sign is desired.

Output, int I4_SIGN, the sign of I.

void
s2_ode113_intrp (
    double x,
    double y [],
    double xout,
    double yout [],
    double ypout [],
    int neqn,
    int kold,
    double phi [],
    double psi []
    )

INTRP approximates the solution at XOUT by polynomial interpolation.

Discussion:

The methods in STEP approximate the solution near X by a polynomial. This routine approximates the solution at XOUT by evaluating the polynomial there. Information defining this polynomial is passed from STEP, so INTRP cannot be used alone.

Licensing:

This code is distributed under the GNU LGPL license.

Modified:

01 February 2012

Author:

Original FORTRAN77 version by Lawrence Shampine, Marilyn Gordon. C version by John Burkardt.

Reference:

Lawrence Shampine, Marilyn Gordon, Computer Solution of Ordinary Differential Equations: The Initial Value Problem, Freeman, 1975, ISBN: 0716704617, LC: QA372.S416.

Parameters:

Input, double X, the point where the solution has been computed.

Input, double Y[NEQN], the computed solution at X.

Input, double XOUT, the point at which the solution is desired.

Output, double YOUT[NEQN], the solution at XOUT.

Output, double YPOUT[NEQN], the derivative of the solution at XOUT.

Input, int NEQN, the number of equations.

Input, int KOLD, the order used for the last successful step.

Input, double PHI[NEQN*16], contains information about the interpolating polynomial.

Input, double PSI[12], contains information about the interpolating polynomial.

double
r8_epsilon (void)

R8_EPSILON returns the R8 round off unit.

Discussion:

R8_EPSILON is a number R which is a power of 2 with the property that, to the precision of the computer’s arithmetic, 1 < 1 + R but 1 = ( 1 + R / 2 )

Licensing:

This code is distributed under the GNU LGPL license.

Modified:

01 September 2012

Author:

John Burkardt

Parameters:

Output, double R8_EPSILON, the R8 round-off unit.

void
s2_context_freeOde113 (s2_context_t* context)

free a numerical integrator datastructure for ode113 integration type

void
s2_context_integrateEquationsOde113 (s2_context_t* context)

integrate equations using ode113 integration method

void
s2_context_allocOde113b (s2_context_t*)

allocate memory for ode113b numerical integrator

void
s2_context_freeOde113b (s2_context_t*)

free memory for ode113b integrator

void
s2_ode113b_fcn (
    double y [],
    s2_context_t*
    )

solve for current time step

void
s2_ode113b_de (
    void  f double y[], s2_context_t *context,
    s2_context_t* context
    )

subroutine de integrates a system of neqn first order ordinary differential equations of the form

dy(i)/dt = f(t,y(1),y(2),…,y(neqn)) y(i) given at t .

the subroutine integrates from t to tout . on return the parameters in the call list are initialized for continuing the integration. the user has only to define a new value tout and call de again.

de calls two codes, the integrator step and the interpolation routine intrp . step uses a modified divided difference form of the adams pece formulas and local extrapolation. it adjusts the order and step size to control the local error. normally each call to step advances the solution one step in the direction of tout . though never beyond t + 10*(tout-t), and calls intrp to interpolate the solution at tout . an option is provided to stop the integration at tout but it should be used only if it is impossible to continue the integration beyond tout .

this code is completely explained and documented in the text, computer solution of ordinary differential equations: the initial value problem by l. f. shampine and m. k. gordon.

the parameters for de are: f subroutine f(t,y,yp) to evaluate derivatives yp(i)=dy(i)/dt neqn number of equations to be integrated y(*) solution vector at t t independent variable tout point at which solution is desired relerr,abserr relative and absolute error tolerances for local error test. at each step the code requires abs(local error) .le. abs(y)*relerr + abserr for each component of the local error and solution vectors iflag indicates status of integration

first call to de

the user must provide storage in his calling program for the array in the call list, y(neqn), declare f in an external statement, supply the subroutine f(t,y,yp) to evaluate dy(i)/dt = yp(i) = f(t,y(1),y(2),…,y(neqn)) and initialize the parameters: neqn number of equations to be integrated y(*) vector of initial conditions t starting point of integration tout point at which solution is desired relerr,abserr relative and absolute local error tolerances iflag +1,-1. indicator to initialize the code. normal input is +1. the user should set iflag=-1 only if it is impossible to continue the integration beyond tout . all parameters except f , neqn and tout may be altered by the code on output so must be variables in the calling program.

output from de

neqn unchanged y(*) solution at t t last point reached in integration. normal return has t = tout . tout unchanged relerr,abserr normal return has tolerances unchanged. iflag=3 signals tolerances increased iflag = 2 normal return. integration reached tout = 3 integration did not reach tout because error tolerances too small. relerr , abserr increased appropriately for continuing = 5 integration did not reach tout because equations appear to be stiff = 6 invalid input parameters (fatal error) the value of iflag is returned negative when the input value is negative and the integration does not reach tout , i.e., -3, -4, -5.

subsequent calls to de

subroutine de returns with all information needed to continue the integration. if the integration reached tout , the user need only define a new tout and call again. if the integration did not reach tout and the user wants to continue, he just calls again. the output value of iflag is the appropriate input value for subsequent calls. the only situation in which it should be altered is to stop the integration internally at the new tout , i.e., change output iflag=2 to input iflag=-2 . error tolerances may be changed by the user before continuing. all other parameters must remain unchanged.

void
s2_context_integrateEquationsOde113b (s2_context_t* context)

placeholder for integrating using ode113b method

Macros

#define _SHIFT_H_

Shift: A dynamics engine and visualization tool for automation and robotics Kristopher Wehage, 2016

Kristopher Wehage