Simbody  3.5
ObservedPointFitter.h
Go to the documentation of this file.
1 #ifndef SimTK_SIMBODY_OBSERVED_POINT_FITTER_H_
2 #define SimTK_SIMBODY_OBSERVED_POINT_FITTER_H_
3 
4 /* -------------------------------------------------------------------------- *
5  * Simbody(tm) *
6  * -------------------------------------------------------------------------- *
7  * This is part of the SimTK biosimulation toolkit originating from *
8  * Simbios, the NIH National Center for Physics-Based Simulation of *
9  * Biological Structures at Stanford, funded under the NIH Roadmap for *
10  * Medical Research, grant U54 GM072970. See https://simtk.org/home/simbody. *
11  * *
12  * Portions copyright (c) 2007-12 Stanford University and the Authors. *
13  * Authors: Peter Eastman *
14  * Contributors: *
15  * *
16  * Licensed under the Apache License, Version 2.0 (the "License"); you may *
17  * not use this file except in compliance with the License. You may obtain a *
18  * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. *
19  * *
20  * Unless required by applicable law or agreed to in writing, software *
21  * distributed under the License is distributed on an "AS IS" BASIS, *
22  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
23  * See the License for the specific language governing permissions and *
24  * limitations under the License. *
25  * -------------------------------------------------------------------------- */
26 
27 #include "SimTKcommon.h"
30 
31 namespace SimTK {
32 
46 public:
52  static Real findBestFit
53  (const MultibodySystem& system,
54  State& state,
55  const Array_<MobilizedBodyIndex>& bodyIxs,
56  const Array_<Array_<Vec3> >& stations,
57  const Array_<Array_<Vec3> >& targetLocations,
58  Real tolerance=0.001);
59 
61  static Real findBestFit
62  (const MultibodySystem& system,
63  State& state,
64  const std::vector<MobilizedBodyIndex>& bodyIxs,
65  const std::vector<std::vector<Vec3> >& stations,
66  const std::vector<std::vector<Vec3> >& targetLocations,
67  Real tolerance=0.001)
68  {
69  Array_<Array_<Vec3> > stationCopy(stations);
70  Array_<Array_<Vec3> > targetCopy(targetLocations);
71  return findBestFit(system,state,
72  ArrayViewConst_<MobilizedBodyIndex>(bodyIxs), // no copying here
73  stationCopy, targetCopy, tolerance);
74  }
75 
90  static Real findBestFit
91  (const MultibodySystem& system,
92  State& state,
93  const Array_<MobilizedBodyIndex>& bodyIxs,
94  const Array_<Array_<Vec3> >& stations,
95  const Array_<Array_<Vec3> >& targetLocations,
96  const Array_<Array_<Real> >& weights,
97  Real tolerance=0.001);
98 
100  static Real findBestFit
101  (const MultibodySystem& system,
102  State& state,
103  const std::vector<MobilizedBodyIndex>& bodyIxs,
104  const std::vector<std::vector<Vec3> >& stations,
105  const std::vector<std::vector<Vec3> >& targetLocations,
106  const std::vector<std::vector<Real> >& weights,
107  Real tolerance=0.001)
108  {
109  Array_<Array_<Vec3> > stationCopy(stations);
110  Array_<Array_<Vec3> > targetCopy(targetLocations);
111  Array_<Array_<Real> > weightCopy(weights);
112  return findBestFit(system,state,
113  ArrayViewConst_<MobilizedBodyIndex>(bodyIxs), // no copying here
114  stationCopy, targetCopy, weightCopy,
115  tolerance);
116  }
117 
118 
119 private:
120  static void createClonedSystem(const MultibodySystem& original, MultibodySystem& copy, const Array_<MobilizedBodyIndex>& originalBodyIxs, Array_<MobilizedBodyIndex>& copyBodyIxs, bool& hasArtificialBaseBody);
121  static void findUpstreamBodies(MobilizedBodyIndex currentBodyIx, const Array_<int> numStations, const SimbodyMatterSubsystem& matter, Array_<MobilizedBodyIndex>& bodyIxs, int requiredStations);
122  static void findDownstreamBodies(MobilizedBodyIndex currentBodyIx, const Array_<int> numStations, const Array_<Array_<MobilizedBodyIndex> > children, Array_<MobilizedBodyIndex>& bodyIxs, int& requiredStations);
123  static int findBodiesForClonedSystem(MobilizedBodyIndex primaryBodyIx, const Array_<int> numStations, const SimbodyMatterSubsystem& matter, const Array_<Array_<MobilizedBodyIndex> > children, Array_<MobilizedBodyIndex>& bodyIxs);
124  class OptimizerFunction;
125 };
126 
127 } // namespace SimTK
128 
129 #endif // SimTK_SIMBODY_OBSERVED_POINT_FITTER_H_
This is for arrays indexed by mobilized body number within a subsystem (typically the SimbodyMatterSu...
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
that it contains events that have triggered but have not been processed Thus it is not a legitimate point along the system’s trajectory and should never be returned to the caller For discussion we label this “improper” state EMBED Equation DSMT4 The event handler will correct the state creating a modified state with time still at thigh but not triggering any events We label the modified state EMBED Equation DSMT4 Once the system’s handler the state EMBED Equation DSMT4 can be output as part of the trajectory and used as the initial condition for the next continuous interval Thus the time stepper generates the sequence of legitimate trajectory points just prior to event immediately followed by EMBED Equation DSMT4 which is the time at which the but after the event handler has modified the state to deal with those events Consecutive intervals I and I will consist of trajectory points EMBED Equation DSMT4 with round brackets indicating that EMBED Equation DSMT4 is not part of the trajectory Event handlers Event handlers are solvers which are able to take a state in an resolve the set up appropriate event triggers for the next and report back to the time stepper the degree to which the system continuity has been so that the integrator can be reinitialized appropriately An event handler can also indicate that the simulation should be in which case the time stepper will return the final state to its caller and disallow further time stepping Other event types Not all events have to be localized There are several special case clock user interrupt control is returned to the time stepper The time stepper can then declare that a scheduled event has call the system’s event and reinitialize the integrator if continuity has been violated Time advanced events occur whenever the integrator has advanced time that at the end of every successful internal integration step These are generally restricted to discrete variable updates which do not affect the continuous system
Definition: SimmathUserGuide.doc:227
Every Simbody header and source file should include this header before any other Simbody header...
SimTK_Real Real
This is the default compiled-in floating point type for SimTK, either float or double.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:593
F Î IÁ A7 Î Î ¶ µ e2 Ì ½6 ÃJ ÿÿÿÿ °Ûþ ¿Ê …8 q2 L F ô F ¸ ½6 F ½6 p IÁ IÁ Î IÁ IÁ IÁ IÁ IÁ C7 C7 Î IÁ IÁ IÁ IÁ IÁ IÁ IÁ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ F IÁ IÁ IÁ IÁ IÁ IÁ IÁ IÁ IÁ â Michael Peter Eastman Permission is hereby free of to any person obtaining a copy of this to deal in the Document without including without limitation the rights to and or sell copies of the and to permit persons to whom the Document is furnished to do subject to the following WITHOUT WARRANTY OF ANY EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR ARISING OUT OF OR IN CONNECTION WITH THE DOCUMENT OR THE USE OR OTHER DEALINGS IN THE DOCUMENT Acknowledgment SimTK software and all related activities are funded by the HYPERLINK vectors and matrices PAGEREF _Toc251069768 h HYPERLINK l _Toc251069769 Linear algebra PAGEREF _Toc251069769 h HYPERLINK l _Toc251069770 Solving Linear Systems(SimTK::FactorLU)PAGEREF _Toc251069770\h5HYPERLINK\l"_Toc251069771"3.2 Linear Least Squares(SimTK otherwise the best guess is that tevent is in the middle of the window Finite width localization windows create a likelihood that multiple events will occur within the same window We cannot say with certainty in what order these events so for precise treatment they must be considered simultaneous If an approximate ordering is acceptable then the integrator’s tevent guesses can be used to order the events within the but even those may be identical for some and in any case the integrator cannot guarantee that the events actually occurred in the order they appear when sorted by estimated time of occurrence If more precise information is then the localization window must be made at the cost of increased computation time Once an event has been localized to an acceptable tolerance
Definition: SimmathUserGuide.doc:41
This class attempts to find the configuration of an internal coordinate model which best fits a set o...
Definition: ObservedPointFitter.h:45
This object is intended to contain all state information for a SimTK::System, except topological info...
Definition: State.h:276
Includes internal headers providing declarations for the basic SimTK Core classes, including Simmatrix.
F Î IÁ A7 Î Î ¶ µ e2 Ì ½6 ÃJ ÿÿÿÿ °Ûþ ¿Ê …8 q2 L F ô F ¸ ½6 F ½6 p IÁ IÁ Î IÁ IÁ IÁ IÁ IÁ C7 C7 Î IÁ IÁ IÁ IÁ IÁ IÁ IÁ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ ÿÿÿÿ F IÁ IÁ IÁ IÁ IÁ IÁ IÁ IÁ IÁ â Michael Peter Eastman Permission is hereby free of to any person obtaining a copy of this to deal in the Document without including without limitation the rights to copy
Definition: SimmathUserGuide.doc:20
The SimTK::Array_<T> container class is a plug-compatible replacement for the C++ standard template l...
Definition: Array.h:50
The job of the MultibodySystem class is to coordinate the activities of various subsystems which can ...
Definition: MultibodySystem.h:48
This Array_ helper class is the base class for ArrayView_ which is the base class for Array_; here we...
Definition: Array.h:48
#define SimTK_SIMBODY_EXPORT
Definition: Simbody/include/simbody/internal/common.h:72
This subsystem contains the bodies ("matter") in the multibody system, the mobilizers (joints) that d...
Definition: SimbodyMatterSubsystem.h:133