ResponseExpression

Model ElementResponseExpression computes the value of an expression that is composed from design variables and other responses.

Class Name

ResponseExpression

Attribute Summary

Name Property Modifiable by Command? Designable
label Str ()    
function Str ()   Yes
symbols List ()    
variables List ()    
scale Double (1)    

Usage

ResponseExpression (function=expressionString, symbols=[…], variables=[…])

Attributes

Defined as the an algebraic expression involving Dvs and Rvs.
function
String
An algebraic expression involving Dvs and Rvs.
The function attribute is mandatory.
symbols
List
Symbols that are used in the expression given.
The symbols attribute is mandatory.
variables
List
Solver entities (Dv/Responses) that symbols represent.
The variables attribute is mandatory.
scale
Double
Specifies the scale factor to scale the ResponseExpression value. If not specified, it defaults to 1.0.
This attribute is optional.
Optional attribute.
label
String
Specifies the name of the ResponseExpression object.
This attribute is optional. When not specified, MotionSolve creates a label for you.
scale
Double
Specifies the scale factor to scale the ResponseExpression value. If not specified, it defaults to 1.0.
This attribute is optional.

Examples

# 1: ResponseExpression as an explicit function of DVs

# kp, kd, ki are three Dvs
kp = Dv(label = 'Proportionality coefficient', b = 0.5, blimit = [0,1])
ki = Dv(label = 'Integral coefficient',        b = 0.5, blimit = [0,1])
kd = Dv(label = 'Derivative coefficient',      b = 0.5, blimit = [0,1])

# The ResponseExpression  is a function of these 3 Dvs 
self.R4 = ResponseExpression (
    label     = 'sum of squares',
function  = '1 - x**2 - y**2 - z**2',
symbols   = ['x', 'y', 'z'],
variables = [kp, kd, ki]
  )

#2: Slope of steer angle vs. Ride height curve at T=5.0

# Ride Height @ T=4.9
rideH49 =  ValueAtTime (
   label         = "RideHeight@49",
   measuredValue = "DZ(30701024,30701025,10701021)",
   atTime        = 4.90,
   delta         = 0.1,
  )

# Ride Height @ T=5.1
rideH51 =  ValueAtTime (
   label         = "RideHeight@51",
   measuredValue = "DZ(30701024,30701025,10701021)",
   atTime        = 5.10,
   delta         = 0.1,
  )

# Steer @ T=4.9
steer49 = ValueAtTime (
   label         = "Steer@49",
   measuredValue = "1000*YAW(30701025,30701024)*RTOD",
   atTime        = 4.90,
   delta         = 0.1,
  )

# Steer @ T=5.1
steer51 = ValueAtTime (
   label         = "Steer@51",
   measuredValue = "1000*YAW(30701025,30701024)*RTOD",
   atTime        = 5.10,
   delta         = 0.1,
  )

# Ride steer at T=5.0
rideSteer50 = ResponseExpression (
   label     = 'Slope of steer angle vs. Ride height curve at T=5.0',
   function  = '(y2-y1)/(x2-x1)',
   symbols   = ['y2', 'y1', 'x2', 'x1'],
   variables = [steer51, steer49, rideH51, rideH49]
  )