How to write predefined x nodes in constraints.xml file

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Ruoli Wang
Posts: 35
Joined: Tue Oct 13, 2009 7:10 am

How to write predefined x nodes in constraints.xml file

Post by Ruoli Wang » Tue Nov 15, 2011 3:03 pm

Hi all,

I want to write pre-defined x nodes values in the CMC_constraint.xml file.
e.g.
<x_nodes>
<ControlLinearNode name="">
<t> 0.20999999999999999000 </t>
<value> 0.01000000000000000000 </value>
</ControlLinearNode>

Is there any easy way to write the values (stored in excel file) to xml file in the above format? Anyone has experiences?

Thank you in advance,

Ruoli

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

Re: How to write predefined x nodes in constraints.xml file

Post by Ayman Habib » Tue Nov 15, 2011 3:32 pm

Hi Ruoli,

The excitation editor should be able to help you. It reads sto files and writes XML files. Please give that a try and let me know if you need further help.

Best regards,
-Ayman

User avatar
Ruoli Wang
Posts: 35
Joined: Tue Oct 13, 2009 7:10 am

Re: How to write predefined x nodes in constraints.xml file

Post by Ruoli Wang » Wed Nov 16, 2011 8:30 am

Hi Ayman,

Thank you for your reply.

I have tried excitation editor, but I can not really save it, always got runtime error with java.exe. I saved the predefined controls (e.g. gasmed_r) in a .sto file , then loaded control of gasmed_r from a regular cmc_constraint.xml. When I right click the grid panel, there is an option 'import data from a file', which I can load the predefined .sto file. I have tried to 'save, save as or new', but error window pop up. Did I do something wrong?

I knew it is possible to manipulate excitation at particular selected point, but it takes time to edit each point.

Thank you,

Ruoli

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

Re: How to write predefined x nodes in constraints.xml file

Post by Ayman Habib » Thu Nov 17, 2011 12:53 pm

Hi Ruoli,

Can you please post a short version of your .sto file to try it out in my environment? You could also use a pre-existing control constraints file and edit it in the excitation editor.

Best,
-Ayman

User avatar
Ruoli Wang
Posts: 35
Joined: Tue Oct 13, 2009 7:10 am

Re: How to write predefined x nodes in constraints.xml file

Post by Ruoli Wang » Thu Nov 17, 2011 2:06 pm

Hi Ayman,

I have uploaded a short .sto file as an attachment (changed to .txt for uploading). I can not either save it in an existing control constraints file or the software just crashed.

I tried to edit in excitation editor, but it is kind of taking time to edit each point.
Attachments
control.txt
(11.07 KiB) Downloaded 68 times

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

Re: How to write predefined x nodes in constraints.xml file

Post by Ayman Habib » Thu Nov 17, 2011 3:03 pm

Hi,

The excitationEditor (from the Edit menu) doesn't directly edit .sto files, however the entry point from the forwardTool allows you to do that, so what I did was:
1. Load any model into the GUI.
2. Open Forward Tool and browse for your control.sto file (I removed excessive blank tabs beforehand) as a controls file.
3. Use pencil tool to edit the file.
4. Save the file as "control.xml".

Use the "Help" button for quick editing tips in the excitationEditor.

Hope this helps,
-Ayman

User avatar
Ruoli Wang
Posts: 35
Joined: Tue Oct 13, 2009 7:10 am

Re: How to write predefined x nodes in constraints.xml file

Post by Ruoli Wang » Fri Nov 18, 2011 6:40 am

Hi Ayman,

What you suggested works!

Thank you,

Ruoli

POST REPLY