MaxVal

Computes the maximum value of a user specified function, which could be a MotionSolve expression or a user subroutine.

The maximum value of a signal f ( q ( t ) ) MathType@MTEF@5@5@+= feaagKart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaebbnrfifHhDYfgasaacH8srps0l bbf9q8WrFfeuY=Hhbbf9v8qiqrFr0xc9pk0xbba9q8WqFfea0=yr0R Yxir=Jbba9q8aq0=yq=He9q8qqQ8frFve9Fve9Ff0dmeGabeqadiWa ceGabeqabeqadeqadeaakeaacaWGMbWaaeWaaeaacaWGXbGaaiikai aadshacaGGPaaacaGLOaGaayzkaaaaaa@37B3@ satisfies the following condition: If T* is the point in time when is f ( q ( t ) ) MathType@MTEF@5@5@+= feaagKart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaebbnrfifHhDYfgasaacH8srps0l bbf9q8WrFfeuY=Hhbbf9v8qiqrFr0xc9pk0xbba9q8WqFfea0=yr0R Yxir=Jbba9q8aq0=yq=He9q8qqQ8frFve9Fve9Ff0dmeGabeqadiWa ceGabeqabeqadeqadeaakeaacaWGMbWaaeWaaeaacaWGXbGaaiikai aadshacaGGPaaacaGLOaGaayzkaaaaaa@37B3@ maximum, then f ( q ( T * ) ) f ( q ( t ) ) MathType@MTEF@5@5@+= feaagKart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaebbnrfifHhDYfgasaacH8srps0l bbf9q8WrFfeuY=Hhbbf9v8qiqrFr0xc9pk0xbba9q8WqFfea0=yr0R Yxir=Jbba9q8aq0=yq=He9q8qqQ8frFve9Fve9Ff0dmeGabeqadiWa ceGabeqabeqadeqadeaakeaacaWGMbWaaeWaaeaacaWGXbGaaiikai aadsfacaGGQaGaaiykaaGaayjkaiaawMcaaiabgsMiJkaadAgadaqa daqaaiaadghacaGGOaGaamiDaiaacMcaaiaawIcacaGLPaaaaaa@3FB2@ when t ≠T*. If the expression has no maximum value, the initial value will be returned as the maximum value.

A smooth approximation to the MAX function is implemented in MotionSolve, so that its sensitivities are analytically computed. The smooth approximation, known as the alpha soft approximation, is:

(1)
M a x v a l ( x ) = 0 T x ( t )   e a x ( t )   d t 0 T e a x ( t )   d t MathType@MTEF@5@5@+= feaagKart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbdfwBIj xAHbstHrhAaerbuLwBLnhiov2DGi1BTfMBaeXafv3ySLgzGmvETj2B SbqeeuuDJXwAKbsr4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqr Ffpeea0xe9Lq=Jc9vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0F irpepeKkFr0xfr=xfr=xb9adbaGaaiGadmWaamaaciGaaeWaceabca GcqqaaaaaaOpGqSvxza8qabaGaamytaiaadggacaWG4bGaamODaiaa dggacaWGSbGaaiikaiaadIhacaGGPaGaeyypa0ZaaSaaaeaadaWdXa qaaiaadIhacaGGOaGaamiDaiaacMcacaqGGaGaamyzamaaCaaaleqa baGaamyyaiaadIhacaGGOaGaamiDaiaacMcaaaGccaqGGaGaamizai aadshaaSqaaiaaicdaaeaacaWGubaaniabgUIiYdaakeaadaWdXaqa aiaadwgadaahaaWcbeqaaiaadggacaWG4bGaaiikaiaadshacaGGPa aaaOGaaeiiaiaadsgacaWG0baaleaacaaIWaaabaGaamivaaqdcqGH RiI8aaaaaaa@611A@
The parameter a > 0 MathType@MTEF@5@5@+= feaagKart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbdfgBPj MCPbqefqvATv2CG4uz3bIuV1wyUbqeduuDJXwAKbYu51MyVXgaruWq VvNCPvMCG4uz3bqeeuuDJXwAKbsr4rNCHbGeaGqiVu0Je9sqqrpepC 0xbbL8F4rqqrFfpeea0xe9Lq=Jc9vqaqpepm0xbba9pwe9Q8fs0=yq aqpepae9pg0FirpepeKkFr0xfr=xfr=xb9adbaGaaiGadmWaamaaci GaaqqaceqbcaGcbaGaamyyaiabg6da+iaaicdaaaa@3FA6@ is used to control the accuracy of the calculations.
Note: M a x ( x ) = lim M a x v a l ( x ) MathType@MTEF@5@5@+= feaagKart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbdfwBIj xAHbstHrhAaerbuLwBLnhiov2DGi1BTfMBaeXafv3ySLgzGmvETj2B SbqeeuuDJXwAKbsr4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqr Ffpeea0xe9Lq=Jc9vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0F irpepeKkFr0xfr=xfr=xb9adbaGaaiGadmWaamaaciGaaeWaceabca GcbaGaaeytaiaabggacaqG4bGaaiikaiaabIhacaGGPaGaeyypa0Za aCbeaeaaciGGSbGaaiyAaiaac2gaaSqaaiaadggacqGHsgIRcqGHEi sPaeqaaOGaamytaiaadggacaWG4bGaamODaiaadggacaWGSbGaaiik aiaadIhacaGGPaaaaa@4FA3@ .

The default value of a MathType@MTEF@5@5@+= feaagKart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbdfgBPj MCPbqefqvATv2CG4uz3bIuV1wyUbqeduuDJXwAKbYu51MyVXgaruWq VvNCPvMCG4uz3bqeeuuDJXwAKbsr4rNCHbGeaGqiVu0Je9sqqrpepC 0xbbL8F4rqqrFfpeea0xe9Lq=Jc9vqaqpepm0xbba9pwe9Q8fs0=yq aqpepae9pg0FirpepeKkFr0xfr=xfr=xb9adbaGaaiGadmWaamaaci GaaqqaceqbcaGcbaGaamyyaaaa@3DE4@ is +10 and it should work for most of use cases.

Example

Assume that you are designing a suspension system and there is an upper limit on the maximum acceleration of the chassis.

Here is a code snippet that shows how the response should be defined with MaxVal:

>>> # Define the maximum of acceleration
>>> maxAcc = MaxVal(function = "ACCZ({})".format(p.cm.id))