PrescribedForce

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Samane Amini
Posts: 101
Joined: Sun Jan 12, 2020 3:48 am

PrescribedForce

Post by Samane Amini » Tue Mar 09, 2021 5:47 am

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

Tags:

User avatar
Samane Amini
Posts: 101
Joined: Sun Jan 12, 2020 3:48 am

Re: PrescribedForce

Post by Samane Amini » Tue Mar 09, 2021 7:08 am

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)

User avatar
Ayman Habib
Posts: 2248
Joined: Fri Apr 01, 2005 12:24 pm

Re: PrescribedForce

Post by Ayman Habib » Tue Mar 09, 2021 10:40 am

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

POST REPLY