Hi guys
I was wondering if how I could use PrescribedForce in matlab to apply a force into calcn_r or other points.
in C++ :
PrescribedForce("prescribedForce", *block)
but it's not work in matlab
Thanks for guiding me
PrescribedForce
- Samane Amini
- Posts: 101
- Joined: Sun Jan 12, 2020 3:48 am
- Samane Amini
- Posts: 101
- Joined: Sun Jan 12, 2020 3:48 am
Re: PrescribedForce
Hi again
as I mentioned about Prescribedforce, I use this cod:
prescribedForce = PrescribedForce();
prescribedForce.setFrameName('calcn_r')
yy = Constant(10000);
pp = Constant(0);
prescribedForce.setForceFunctions(yy,pp,pp)
prescribedForce.setPointFunctions (pp,pp,pp)
HGait.addForce(prescribedForce)
but it's not work and the following error is occurred:
Java exception occurred:
java.io.IOException: Failed to connect Socket 'frame' of type PhysicalFrame (details: Component 'prescribedforce' could not find 'calcn_r' of
type PhysicalFrame. Make sure a component exists at this path and that it is of the correct type.
Thrown at Component.h:764 in getComponent().).
In Object 'prescribedforce' of type PrescribedForce.
Thrown at Component.cpp:314 in finalizeConnections().
at org.opensim.modeling.opensimSimulationJNI.Model_initSystem(Native Method)
at org.opensim.modeling.Model.initSystem(Model.java:848)
as I mentioned about Prescribedforce, I use this cod:
prescribedForce = PrescribedForce();
prescribedForce.setFrameName('calcn_r')
yy = Constant(10000);
pp = Constant(0);
prescribedForce.setForceFunctions(yy,pp,pp)
prescribedForce.setPointFunctions (pp,pp,pp)
HGait.addForce(prescribedForce)
but it's not work and the following error is occurred:
Java exception occurred:
java.io.IOException: Failed to connect Socket 'frame' of type PhysicalFrame (details: Component 'prescribedforce' could not find 'calcn_r' of
type PhysicalFrame. Make sure a component exists at this path and that it is of the correct type.
Thrown at Component.h:764 in getComponent().).
In Object 'prescribedforce' of type PrescribedForce.
Thrown at Component.cpp:314 in finalizeConnections().
at org.opensim.modeling.opensimSimulationJNI.Model_initSystem(Native Method)
at org.opensim.modeling.Model.initSystem(Model.java:848)
- Ayman Habib
- Posts: 2252
- Joined: Fri Apr 01, 2005 12:24 pm
Re: PrescribedForce
Hello,
You'll likely need a full component path rather than just a body name, so something along the lines of '/bodyset/calcn_r'. You should be able to see the full component path for your specific model in the application by hovering over the corresponding node in the navigator panel.
Hope this helps,
-Ayman
You'll likely need a full component path rather than just a body name, so something along the lines of '/bodyset/calcn_r'. You should be able to see the full component path for your specific model in the application by hovering over the corresponding node in the navigator panel.
Hope this helps,
-Ayman