コード例 #1
0
ファイル: custom_parameters.py プロジェクト: pyomeca/bioptim
def my_parameter_function(biorbd_model: biorbd.Model, value: MX, extra_value: Any):
    """
    The pre dynamics function is called right before defining the dynamics of the system. If one wants to
    modify the dynamics (e.g. optimize the gravity in this case), then this function is the proper way to do it.

    Parameters
    ----------
    biorbd_model: biorbd.Model
        The model to modify by the parameters
    value: MX
        The CasADi variables to modify the model
    extra_value: Any
        Any parameters required by the user. The name(s) of the extra_value must match those used in parameter.add
    """

    value[2] *= extra_value
    biorbd_model.setGravity(value)
コード例 #2
0
def my_parameter_function(biorbd_model: biorbd.Model, value: MX,
                          extra_value: Any):
    value[2] *= extra_value
    biorbd_model.setGravity(value)