Scaling Mechanism

Both Dv and Response can be scaled in msolve.

Additional properties are provided (factor, mean, scaleBySen in Dv and factor in Response) for scaling and you don’t need to change the rest of code.

Scaling Dv

When factor and mean are specified, the value of Dv is calculated by the following:

D v = D v . b × f a c t o r + m e a n MathType@MTEF@5@5@+= feaagKart1ev2aqatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr 4rNCHbGeaGqiVu0Je9sqqrpepC0xbbL8F4rqqrFfpeea0xe9Lq=Jc9 vqaqpepm0xbba9pwe9Q8fs0=yqaqpepae9pg0FirpepeKkFr0xfr=x fr=xb9adbaqaaeGaciGaaiaabeqaamaabaabaaGcbaGaamiraiaadA hacqGH9aqpcaWGebGaamODaiaac6cacaWGIbGaey41aqRaamOzaiaa dggacaWGJbGaamiDaiaad+gacaWGYbGaey4kaSIaamyBaiaadwgaca WGHbGaamOBaaaa@4869@

scaleBySenis a Boolean flag that determines how Dvs are scaled in automatic scaling; the default value is true, meaning that Dvs are scaled by the sensitivity of objective function.

Example

The example below shows how you can use a scaled Dv as the mass of a rigid body:

>>> # Create a scaled Dv
>>> dv   = Dv(b=1.0, mean=1.0, factor=2.0)

>>> # Create a Part with designable mass; the current value of mass is 3.0
>>> part = Part(mass=dv, ip=[10,10,10], cm=Marker())

Scaling Response

Every response class can be scaled if factor is given. The value/sensitivity of the scaled response is the value/sensitivity of the original one multiplied by the scaling factor.

Example

The example below shows how you can create a scaled RMS2:
>>> # Create RMS2 and scale it by 0.01
>>> dx_coupler = "DX({marker})".format(marker=m.coupler.cm.id) 
>>> a2x        = RMS2(targetValue=xy, measuredValue=dx_coupler, factor=0.01)

Scaling could help the optimization problem converge. For more details, please refer to the Advanced Topics section.