# hopefully a stupid question

This may be really easy, but I can’t seem to figure it out.

I created a segment and constrained it to the globalRef rotations and to have
the same z
position via the code:

AnySeg LeftFootForcePhantomSeg = {
Mass = 0;
Jii = {0,0,0};
};

AnyKinEq LeftFootForcePhantomSegFix = {
//constrain the segment to have the same z coord as the global ground
AnyKinLinear lin = {
AnyRefFrame &ground = Main.Model.EnvironmentModel.GlobalRef;
AnyRefFrame &plateground = …LeftFootForcePhantomSeg;
};
//constrain the segment to have the same rotation as the globalRef
AnyKinRotational rot = {
AnyRefFrame &ground = Main.Model.EnvironmentModel.GlobalRef;
AnyRefFrame &plate = …LeftFootForcePhantomSeg;
Type = RotAxesAngles;
};
MeasureOrganizer = {2,3,4,5}; //include the rotations and the z component
Reaction.Type = {On, On, On, On}; //JR: Reaction.Type = {Off, On, On, On};
};

There are 2 degrees of freedom left (in the global ref frame…they are along
the x and y
directions). I would like to set these two dof to points calculated in the code
that change
at each time step. These points are not associated with an AnyRefFrame, I just
have them
stored in a vector (lets call it tempPoint for this discussion).

I would like to be able to do something like this:

AnyKinEq LeftFootForcePhantomSegPosition = {
AnyKinLinear lin = {
AnyRefFrame &pos = tempPoint;
AnyRefFrame &seg = Main.Model.EnvironmentModel.LeftFootForcePhantomSeg;
};
MeasureOrganizer = {0,1}
Reaction.Type = {On, On};
};

However, this obviously does not work because tempPoint is not an AnyRefFrame.
I don’t
think an AnyKinEqSimpleDriver is appropriate, because I do not know all the
positions
before things get initiailized.

Can I create an fake reference frame some how at every time step?

Any Thoughts?

-David

Hi David

This is not so easy i think…

it might be possible to do a AnyKinLinComb and use this for driving
the model.

If the vectors are not calculated based on AnyRefFrames then it can
not be done in the same study i think. Then you will need to first
run the study, create an output file with the position vector. Then
reload the model and use an AnyKinEqinterPolDriver for driving the
positions.

I guess this is not what you hoped for but i do not think it is
possible to do this is one “go” if the calculated positions are not
based on AnyKinMeasures.

Best regards
SÃ¸ren, AnyBody Support

— In anyscript@yahoogroups.com, “dww805” <dwwagner@…> wrote:
>
> This may be really easy, but I can’t seem to figure it out.
>
> I created a segment and constrained it to the globalRef rotations
and to have the same z
> position via the code:
>
> AnySeg LeftFootForcePhantomSeg = {
> Mass = 0;
> Jii = {0,0,0};
> };
>
> AnyKinEq LeftFootForcePhantomSegFix = {
> //constrain the segment to have the same z coord as the global
ground
> AnyKinLinear lin = {
> AnyRefFrame &ground = Main.Model.EnvironmentModel.GlobalRef;
> AnyRefFrame &plateground = …LeftFootForcePhantomSeg;
> };
> //constrain the segment to have the same rotation as the
globalRef
> AnyKinRotational rot = {
> AnyRefFrame &ground = Main.Model.EnvironmentModel.GlobalRef;
> AnyRefFrame &plate = …LeftFootForcePhantomSeg;
> Type = RotAxesAngles;
> };
> MeasureOrganizer = {2,3,4,5}; //include the rotations and the
z component
> Reaction.Type = {On, On, On, On}; //JR: Reaction.Type = {Off,
On, On, On};
> };
>
> There are 2 degrees of freedom left (in the global ref
frame…they are along the x and y
> directions). I would like to set these two dof to points
calculated in the code that change
> at each time step. These points are not associated with an
AnyRefFrame, I just have them
> stored in a vector (lets call it tempPoint for this discussion).
>
> I would like to be able to do something like this:
>
> AnyKinEq LeftFootForcePhantomSegPosition = {
> AnyKinLinear lin = {
> AnyRefFrame &pos = tempPoint;
> AnyRefFrame &seg =
Main.Model.EnvironmentModel.LeftFootForcePhantomSeg;
> };
> MeasureOrganizer = {0,1}
> Reaction.Type = {On, On};
> };
>
> However, this obviously does not work because tempPoint is not an
AnyRefFrame. I don’t
> think an AnyKinEqSimpleDriver is appropriate, because I do not
know all the positions
> before things get initiailized.
>
> Can I create an fake reference frame some how at every time step?
>
> Any Thoughts?
>
>
> -David
>

Hi SÃ¸ren-

I have implemented a double looping procedure before, but I would prefer not to
have to
do that.

I did try the AnyKinLinComb before, and I thought it was real close to working.
Unfortunately, the coefficients used to make the linear combination are based on
“OutputVars” and when I try to initialize the model, I get the error that I
don’t have access
to those values yet (which makes sense…because they haven’t been initialized
yet).

Do you know of a way to implement AnyKinLinComb such that I can use changing
values
for the coefficients?

Best Regards,
David

— In anyscript@yahoogroups.com, “AnyBody Support” <support@…> wrote:
>
> Hi David
>
>
> This is not so easy i think…
>
> If the vector your are calculating are made using kinematic measured
> it might be possible to do a AnyKinLinComb and use this for driving
> the model.
>
> If the vectors are not calculated based on AnyRefFrames then it can
> not be done in the same study i think. Then you will need to first
> run the study, create an output file with the position vector. Then
> reload the model and use an AnyKinEqinterPolDriver for driving the
> positions.
>
> I guess this is not what you hoped for but i do not think it is
> possible to do this is one “go” if the calculated positions are not
> based on AnyKinMeasures.
>
>
> Best regards
> SÃ¸ren, AnyBody Support
>
> — In anyscript@yahoogroups.com, “dww805” <dwwagner@> wrote:
> >
> > This may be really easy, but I can’t seem to figure it out.
> >
> > I created a segment and constrained it to the globalRef rotations
> and to have the same z
> > position via the code:
> >
> > AnySeg LeftFootForcePhantomSeg = {
> > Mass = 0;
> > Jii = {0,0,0};
> > };
> >
> > AnyKinEq LeftFootForcePhantomSegFix = {
> > //constrain the segment to have the same z coord as the global
> ground
> > AnyKinLinear lin = {
> > AnyRefFrame &ground = Main.Model.EnvironmentModel.GlobalRef;
> > AnyRefFrame &plateground = …LeftFootForcePhantomSeg;
> > };
> > //constrain the segment to have the same rotation as the
> globalRef
> > AnyKinRotational rot = {
> > AnyRefFrame &ground = Main.Model.EnvironmentModel.GlobalRef;
> > AnyRefFrame &plate = …LeftFootForcePhantomSeg;
> > Type = RotAxesAngles;
> > };
> > MeasureOrganizer = {2,3,4,5}; //include the rotations and the
> z component
> > Reaction.Type = {On, On, On, On}; //JR: Reaction.Type = {Off,
> On, On, On};
> > };
> >
> > There are 2 degrees of freedom left (in the global ref
> frame…they are along the x and y
> > directions). I would like to set these two dof to points
> calculated in the code that change
> > at each time step. These points are not associated with an
> AnyRefFrame, I just have them
> > stored in a vector (lets call it tempPoint for this discussion).
> >
> > I would like to be able to do something like this:
> >
> > AnyKinEq LeftFootForcePhantomSegPosition = {
> > AnyKinLinear lin = {
> > AnyRefFrame &pos = tempPoint;
> > AnyRefFrame &seg =
> Main.Model.EnvironmentModel.LeftFootForcePhantomSeg;
> > };
> > MeasureOrganizer = {0,1}
> > Reaction.Type = {On, On};
> > };
> >
> > However, this obviously does not work because tempPoint is not an
> AnyRefFrame. I don’t
> > think an AnyKinEqSimpleDriver is appropriate, because I do not
> know all the positions
> > before things get initiailized.
> >
> > Can I create an fake reference frame some how at every time step?
> >
> > Any Thoughts?
> >
> > Thank you in advance.
> >
> > -David
> >
>

Hi David

The coefficients of the AnyKinLinComb are AnyDesVar’s that must be
const in time if this is the case there is one workaround though to
implement this without the double loop.

Anyway if they are constants in time, then you can use the
AnyDesEvalStudy to calculate the numbers for these variables based
on any kind of equation. So you run a AnyDesEvalStudy first to
calculate the coefficients and then use the variables calculated in
this study as the coefficient in the AnyKinLinComb.

I am afraid that this is the only other option except the double
loop.

Best regards
SÃ¸ren, AnyBody Support

— In anyscript@yahoogroups.com, “dww805” <dwwagner@…> wrote:
>
> Hi SÃ¸ren-
>
> I have implemented a double looping procedure before, but I would
prefer not to have to
> do that.
>
> I did try the AnyKinLinComb before, and I thought it was real
close to working.
> Unfortunately, the coefficients used to make the linear
combination are based on
> “OutputVars” and when I try to initialize the model, I get the
error that I don’t have access
> to those values yet (which makes sense…because they haven’t been
initialized yet).
>
> Do you know of a way to implement AnyKinLinComb such that I can
use changing values
> for the coefficients?
>
>
> Best Regards,
> David
>
> — In anyscript@yahoogroups.com, “AnyBody Support” <support@>
wrote:
> >
> > Hi David
> >
> >
> > This is not so easy i think…
> >
> > If the vector your are calculating are made using kinematic
measured
> > it might be possible to do a AnyKinLinComb and use this for
driving
> > the model.
> >
> > If the vectors are not calculated based on AnyRefFrames then it
can
> > not be done in the same study i think. Then you will need to
first
> > run the study, create an output file with the position vector.
Then
> > reload the model and use an AnyKinEqinterPolDriver for driving
the
> > positions.
> >
> > I guess this is not what you hoped for but i do not think it is
> > possible to do this is one “go” if the calculated positions are
not
> > based on AnyKinMeasures.
> >
> >
> > Best regards
> > SÃ¸ren, AnyBody Support
> >
> > — In anyscript@yahoogroups.com, “dww805” <dwwagner@> wrote:
> > >
> > > This may be really easy, but I can’t seem to figure it out.
> > >
> > > I created a segment and constrained it to the globalRef
rotations
> > and to have the same z
> > > position via the code:
> > >
> > > AnySeg LeftFootForcePhantomSeg = {
> > > Mass = 0;
> > > Jii = {0,0,0};
> > > };
> > >
> > > AnyKinEq LeftFootForcePhantomSegFix = {
> > > //constrain the segment to have the same z coord as the
global
> > ground
> > > AnyKinLinear lin = {
> > > AnyRefFrame &ground =
Main.Model.EnvironmentModel.GlobalRef;
> > > AnyRefFrame &plateground
= …LeftFootForcePhantomSeg;
> > > };
> > > //constrain the segment to have the same rotation as the
> > globalRef
> > > AnyKinRotational rot = {
> > > AnyRefFrame &ground =
Main.Model.EnvironmentModel.GlobalRef;
> > > AnyRefFrame &plate = …LeftFootForcePhantomSeg;
> > > Type = RotAxesAngles;
> > > };
> > > MeasureOrganizer = {2,3,4,5}; //include the rotations and
the
> > z component
> > > Reaction.Type = {On, On, On, On}; //JR: Reaction.Type =
{Off,
> > On, On, On};
> > > };
> > >
> > > There are 2 degrees of freedom left (in the global ref
> > frame…they are along the x and y
> > > directions). I would like to set these two dof to points
> > calculated in the code that change
> > > at each time step. These points are not associated with an
> > AnyRefFrame, I just have them
> > > stored in a vector (lets call it tempPoint for this
discussion).
> > >
> > > I would like to be able to do something like this:
> > >
> > > AnyKinEq LeftFootForcePhantomSegPosition = {
> > > AnyKinLinear lin = {
> > > AnyRefFrame &pos = tempPoint;
> > > AnyRefFrame &seg =
> > Main.Model.EnvironmentModel.LeftFootForcePhantomSeg;
> > > };
> > > MeasureOrganizer = {0,1}
> > > Reaction.Type = {On, On};
> > > };
> > >
> > > However, this obviously does not work because tempPoint is not
an
> > AnyRefFrame. I don’t
> > > think an AnyKinEqSimpleDriver is appropriate, because I do not
> > know all the positions
> > > before things get initiailized.
> > >
> > > Can I create an fake reference frame some how at every time
step?
> > >
> > > Any Thoughts?
> > >
> > > Thank you in advance.
> > >
> > > -David
> > >
> >
>