Rigid Body Dynamics Library
TorqueMuscleFunctionFactory.h
Go to the documentation of this file.
1#ifndef TORQUEMUSCLEFUNCTIONFACTORY_H_
2#define TORQUEMUSCLEFUNCTIONFACTORY_H_
3/*-------------------------------------------------------------------------
4 OpenSim: SmoothSegmentedFunctionFactory.cpp
5 --------------------------------------------------------------------------
6 The OpenSim API is a toolkit for musculoskeletal modeling and simulation.
7 See http:%opensim.stanford.edu and the NOTICE file for more information.
8 OpenSim is developed at Stanford University and supported by the US
9 National Institutes of Health (U54 GM072970, R24 HD065690) and by DARPA
10 through the Warrior Web program.
11
12 Copyright (c) 2005-2012 Stanford University and the Authors
13 Author(s): Matthew Millard
14
15 Licensed under the Apache License, Version 2.0 (the 'License'); you may
16 not use this file except in compliance with the License. You may obtain a
17 copy of the License at http:%www.apache.org/licenses/LICENSE-2.0.
18
19 Unless required by applicable law or agreed to in writing, software
20 distributed under the License is distributed on an 'AS IS' BASIS,
21 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 See the License for the specific language governing permissions and
23 limitations under the License.
24 --------------------------------------------------------------------------
25
26 Derivative work
27 Date : September 2016
28 Authors(s): Millard
29 Updates : Made active torque-angle, passive-torque-angle, torque-velocity
30 and tendon-torque-angle curves based on the equivalent line-type
31 curves in OpenSim.
32*/
33
34#include "../geometry/SmoothSegmentedFunction.h"
35#include "../geometry/SegmentedQuinticBezierToolkit.h"
36
37#include <cstdio>
38#include <iostream>
39#include <fstream>
40#include <cmath>
41
42namespace RigidBodyDynamics {
43 namespace Addons {
44 namespace Muscle{
45
47{
48 public:
49
50
86 double c2,
87 double c3,
88 const std::string& curveName,
90 smoothSegmentedFunctionToUpdate);
91
148 double c4,
149 double c5,
150 double c6,
151 double minEccentricMultiplier,
152 double maxEccentricMultiplier,
153 const std::string& curveName,
155 smoothSegmentedFunctionToUpdate);
156
217 double scale,
218 double c1,
219 double b1,
220 double k1,
221 double b2,
222 double k2,
223 const std::string& curveName,
225 smoothSegmentedFunctionToUpdate);
226
227
272 double tvAtEccentricOmegaMax,
273 double tvAtHalfConcentricOmegaMax,
274 const std::string& curveName,
276 smoothSegmentedFunctionToUpdate );
277
349 double tvAtEccentricOmegaMax,
350 double tvAtHalfConcentricOmegaMax,
351 double slopeAtConcentricOmegaMax,
352 double slopeNearEccentricOmegaMax,
353 double slopeAtEccentricOmegaMax,
354 double eccentricCurviness,
355 const std::string& curveName,
357 smoothSegmentedFunctionToUpdate );
358
398 double angleAtZeroTorque,
399 double angleAtOneNormTorque,
400 const std::string& curveName,
402 smoothSegmentedFunctionToUpdate );
403
404
474 double angleAtZeroTorque,
475 double angleAtOneNormTorque,
476 double stiffnessAtLowTorque,
477 double stiffnessAtOneNormTorque,
478 double curviness,
479 const std::string& curveName,
481 smoothSegmentedFunctionToUpdate );
482
483
513 double angleAtOneNormTorque,
514 double angularStandardDeviation,
515 const std::string& curveName,
517 smoothSegmentedFunctionToUpdate
518 );
519
520
569 double angleAtOneNormTorque,
570 double angularStandardDeviation,
571 double minSlopeAtShoulders,
572 double minValueAtShoulders,
573 double curviness,
574 const std::string& curveName,
576 smoothSegmentedFunctionToUpdate
577 );
578
579
608 double angularStretchAtOneNormTorque,
609 const std::string& curveName,
611 smoothSegmentedFunctionToUpdate
612 );
613
658 double angularStretchAtOneNormTorque,
659 double stiffnessAtOneNormTorque,
660 double normTorqueAtToeEnd,
661 double curviness,
662 const std::string& curveName,
664 smoothSegmentedFunctionToUpdate
665 );
666
694 double normAngularVelocityAtMaximumDamping,
695 const std::string& curveName,
697 smoothSegmentedFunctionToUpdate
698 );
699
700};
701}
702}
703}
704#endif //TORQUEMUSCLEFUNCTIONFACTORY_H_
static void createTendonTorqueAngleCurve(double angularStretchAtOneNormTorque, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
static void createGaussianShapedActiveTorqueAngleCurve(double angleAtOneNormTorque, double angularStandardDeviation, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
static void createTendonTorqueAngleCurve(double angularStretchAtOneNormTorque, double stiffnessAtOneNormTorque, double normTorqueAtToeEnd, double curviness, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
static void createTorqueVelocityCurve(double tvAtEccentricOmegaMax, double tvAtHalfConcentricOmegaMax, double slopeAtConcentricOmegaMax, double slopeNearEccentricOmegaMax, double slopeAtEccentricOmegaMax, double eccentricCurviness, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
static void createPassiveTorqueAngleCurve(double angleAtZeroTorque, double angleAtOneNormTorque, double stiffnessAtLowTorque, double stiffnessAtOneNormTorque, double curviness, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
static void createDampingBlendingCurve(double normAngularVelocityAtMaximumDamping, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
static void createAnderson2007ActiveTorqueAngleCurve(double c2, double c3, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
static void createAnderson2007PassiveTorqueAngleCurve(double scale, double c1, double b1, double k1, double b2, double k2, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
static void createAnderson2007ActiveTorqueVelocityCurve(double c4, double c5, double c6, double minEccentricMultiplier, double maxEccentricMultiplier, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
static void createGaussianShapedActiveTorqueAngleCurve(double angleAtOneNormTorque, double angularStandardDeviation, double minSlopeAtShoulders, double minValueAtShoulders, double curviness, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
static void createTorqueVelocityCurve(double tvAtEccentricOmegaMax, double tvAtHalfConcentricOmegaMax, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
static void createPassiveTorqueAngleCurve(double angleAtZeroTorque, double angleAtOneNormTorque, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)