Skip to content

Commit 22007a9

Browse files
Surrogate 1.3
1 parent 7899d7b commit 22007a9

File tree

163 files changed

+134738
-12123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+134738
-12123
lines changed

Step-6-Surrogate-Model/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Step 6 Surrogate Model Preview
1+
# Step 6 Surrogate Model Sampling
22

3-
During Synergy-Driven Treatment Optimization, muscle-tendon length is calculated using polynomial fits of OpenSim length calculations so that the Muscle Analysis tool is not needed at every iteration. Muscle-tendon velocity and moment arms are calculated as analytical derivatives of these polynomials. The script in this folder shows a preview of how well a surrogate model created during Treatment Optimization with the given settings will match Muscle Analysis results.
3+
During Synergy-Driven Treatment Optimization, muscle-tendon length is calculated using polynomial fits of OpenSim length calculations so that the Muscle Analysis tool is not needed at every iteration. Muscle-tendon velocity and moment arms are calculated as analytical derivatives of these polynomials. The script in this folder uses Latin Hypercube Sampling to generate kinematic configurations within a range of the reference kinematics to use in fitting surrogate muscle models.
44

5-
## Running a Surrogate Model Preview
5+
## Running the Surrogate Model Sampling
66

77
To run this step:
88

99
- Make sure the nmsm-core project is loaded (double-click `Project.prj` in the root of nmsm-core if it is not loaded).
1010
- Navigate to the nmsm-tutorial/Step-6-Surrogate-Model directory.
11-
- Open and run the MATLAB script `surrogate.m`.
11+
- Open and run the MATLAB script `surrogateKinematicsScript.m`.
1212

13-
The results will be plotted after surrogate models are created.
13+
This will generate a new set of kinematics within a data directory structure for surrogate model sampling. To complete the surrogate model data directory, a MuscleAnalysis must be run in the OpenSim GUI, using the motion file in IKData as the motion (with no filtering), and with output going to the MAData directory.

Step-6-Surrogate-Model/RightLegAndPelvis.osim

+3,192
Large diffs are not rendered by default.

Step-6-Surrogate-Model/UF_Subject_3_reduced_muscles.osim

-7,045
This file was deleted.

Step-6-Surrogate-Model/preprocessed/EMGData/gait_1.sto

-144
This file was deleted.

Step-6-Surrogate-Model/preprocessed/GRFData/gait_1.sto

-106
This file was deleted.

Step-6-Surrogate-Model/preprocessed/IDData/gait_1.sto

-106
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
Inverse Dynamics Generalized Forces
2+
version=1
3+
nRows=55
4+
nColumns=15
5+
inDegrees=no
6+
endheader
7+
time pelvis_tilt_moment pelvis_list_moment pelvis_rotation_moment pelvis_tx_force pelvis_ty_force pelvis_tz_force hip_flexion_r_moment hip_adduction_r_moment hip_rotation_r_moment knee_angle_r_moment knee_angle_r_beta_force ankle_angle_r_moment subtalar_angle_r_moment mtp_angle_r_moment
8+
0.40000000 -66.32829841 -0.87835816 -7.53552058 128.01098599 324.94341483 35.53962439 -29.00810187 -12.25733805 4.01762610 19.39452460 -0.04114394 2.01755239 -0.37957021 -0.15863930
9+
0.40500000 -66.80251720 -0.51782322 -6.99951262 125.47387328 323.53416398 33.67213535 -30.11245984 -12.10403948 4.38874026 20.53960333 -0.03913994 1.97788815 -0.40520336 -0.16693811
10+
0.41000000 -63.45733607 8.73881839 -7.32599482 97.80523987 295.57574396 15.04526634 -33.72819647 -4.96254324 4.15264474 22.51665397 -0.03142381 1.72930952 -0.27349980 -0.17219310
11+
0.41500000 -60.40653127 15.50820391 -7.68183410 77.93710121 270.47859011 1.71274746 -36.29151590 0.37280367 4.00470912 24.18051968 -0.02461440 1.50196041 -0.19531649 -0.17617023
12+
0.42000000 -56.54333317 21.84608891 -8.17782973 59.28383175 242.45777064 -10.60738457 -38.18169207 5.63924580 3.78221828 25.62704534 -0.01769810 1.27041612 -0.12870216 -0.17901121
13+
0.42500000 -52.04512854 26.42580143 -8.48438338 45.41706298 214.88362273 -19.59537610 -38.78701915 9.93779243 3.56751394 26.67158238 -0.01142866 1.07648178 -0.09456890 -0.18150356
14+
0.43000000 -46.52031619 29.30351509 -8.44658908 35.67041407 187.30245864 -25.64732962 -37.86428757 13.44320909 3.32961201 27.22348710 -0.00566563 0.93613682 -0.08795121 -0.18422631
15+
0.43500000 -39.77101487 30.01594161 -7.78663144 31.06450292 160.75161082 -28.11149130 -35.01812378 15.91523141 3.08301928 27.15823000 -0.00088683 0.87560356 -0.11391828 -0.18788308
16+
0.44000000 -31.48941775 28.40497218 -6.27786677 31.67154559 135.40707284 -26.90438269 -29.93943540 17.32849573 2.81807159 26.36494889 0.00261427 0.91483570 -0.17273842 -0.19307975
17+
0.44500000 -21.40909545 24.29688561 -3.68657587 37.71543391 111.57408548 -21.84849300 -22.33288534 17.61681728 2.53493280 24.73638362 0.00453223 1.07300599 -0.26630088 -0.20036865
18+
0.45000000 -9.26269185 17.66489848 0.16943526 49.04768897 89.23346062 -12.97855579 -11.97306562 16.79408350 2.23006785 22.18022019 0.00511496 1.36482452 -0.39540794 -0.21017841
19+
0.45500000 5.16712480 8.58512231 5.41299196 65.34690434 68.29044860 -0.46281882 1.29019754 14.91607495 1.90350710 18.61733574 0.00363409 1.80076649 -0.56083106 -0.22277474
20+
0.46000000 22.04124545 -2.72156354 12.07684233 86.01748592 48.48903939 15.33667626 17.50450241 12.11296651 1.55404683 13.99618969 0.00009681 2.38562560 -0.76242941 -0.23825541
21+
0.46500000 41.43085168 -15.89172211 20.08390365 110.23887588 29.51957049 33.85646096 36.59534845 8.58802964 1.17784256 8.29905070 -0.00541504 3.11784843 -0.99891056 -0.25653589
22+
0.47000000 63.29011396 -30.41522303 29.22755460 136.97214531 11.07951969 54.30709265 58.34441738 4.62323910 0.76363135 1.54984790 -0.01273887 3.98876302 -1.26716876 -0.27735416
23+
0.47500000 87.42013846 -45.64879739 39.16144467 165.00796658 -7.00694006 75.66407165 82.37035310 0.57114686 0.28826020 -6.18299633 -0.02197722 4.98236934 -1.56175524 -0.30028839
24+
0.48000000 113.45632396 -60.84550056 49.40850892 193.03177434 -24.76372978 96.72606456 108.12482940 -3.16042064 -0.28912731 -14.77004084 -0.03276772 6.07467202 -1.87418920 -0.32481975
25+
0.48500000 140.83586043 -75.19478689 59.37713432 219.69420199 -41.92111638 116.12950858 134.88705900 -6.13812273 -1.02935501 -24.02989119 -0.04489970 7.23457770 -2.19277652 -0.35036849
26+
0.49000000 168.79550438 -87.88083998 68.40261327 243.69922967 -57.87278114 132.43740595 161.78118578 -7.94312543 -2.01330233 -33.72947566 -0.05809429 8.42474387 -2.50262933 -0.37636311
27+
0.49500000 196.38403451 -98.14768465 75.80426134 263.88368974 -71.66989124 144.24694631 187.80717316 -8.21875035 -3.33685081 -43.58973649 -0.07171469 9.60296037 -2.78617530 -0.40229956
28+
0.50000000 222.50415515 -105.37759076 80.96053584 279.31904155 -82.01675293 150.31238753 211.90272953 -6.72359552 -5.09944133 -53.30561561 -0.08543595 10.72491476 -3.02441705 -0.42778911
29+
0.50500000 245.97771923 -109.15487066 83.38515366 289.36868396 -87.36653951 149.67690476 233.01432839 -3.37519526 -7.38739885 -62.56175162 -0.09900324 11.74682784 -3.19859825 -0.45258218
30+
0.51000000 265.63443604 -109.31415345 82.79663416 293.71410418 -86.07559783 141.79336464 250.18066173 1.72086006 -10.25280208 -71.05129220 -0.11197064 12.62836409 -3.29228807 -0.47656034
31+
0.51500000 280.43214232 -105.97463624 79.17479196 292.38824106 -76.57918277 126.62263664 262.63737195 8.26379187 -13.69187734 -78.50049842 -0.12430823 13.33618779 -3.29379434 -0.49970737
32+
0.52000000 289.53708654 -99.51788253 72.76767433 285.68835783 -57.59017870 104.64299433 269.86916787 15.78246865 -17.62750435 -84.68402834 -0.13459670 13.84642355 -3.19816785 -0.52204976
33+
0.52500000 292.44622259 -90.56612484 64.08421248 274.16825833 -28.30247699 76.85761282 271.69501111 23.68296296 -21.90193951 -89.44248305 -0.14196030 14.14740382 -3.00897128 -0.54360970
34+
0.53000000 289.05872920 -79.91544630 53.83790984 258.57361083 11.44454768 44.71199311 268.29685021 31.32255852 -26.28363452 -92.68760968 -0.14585661 14.24100864 -2.73905965 -0.56436558
35+
0.53500000 279.68858721 -68.44436149 42.85632136 239.74407770 61.07148430 9.94871133 260.19376652 38.09187401 -30.48901770 -94.39772013 -0.14567628 14.14256402 -2.41020517 -0.58423384
36+
0.54000000 265.07441420 -57.03342255 31.99148995 218.61328446 119.23138864 -25.53789248 248.21811785 43.49343754 -34.21760359 -94.60647647 -0.14243739 13.87965709 -2.05171603 -0.60307854
37+
0.54500000 246.26522524 -46.46359929 22.00901977 196.08306206 183.90935903 -59.91380493 233.38993849 47.19688241 -37.19212984 -93.38187636 -0.13619208 13.48893491 -1.69773076 -0.62073201
38+
0.55000000 224.51286585 -37.35392235 13.51338941 172.99632798 252.58958242 -91.56176304 216.81242472 49.06370674 -39.19678212 -90.80521436 -0.12709800 13.01204575 -1.38388091 -0.63701410
39+
0.55500000 201.12754848 -30.12080045 6.89946000 150.09219894 322.49649667 -119.21119255 199.54946365 49.13845189 -40.10414801 -86.95082198 -0.11546633 12.49065923 -1.14351948 -0.65172705
40+
0.56000000 177.32271507 -24.96635132 2.33652097 127.94945259 390.87975354 -142.02150010 182.50814825 47.61001738 -39.88510171 -81.87077862 -0.10179415 11.96115892 -1.00399462 -0.66461080
41+
0.56500000 154.07117193 -21.89384653 -0.21901447 106.90959047 455.29144857 -159.61184692 166.34114326 44.75327629 -38.60018368 -75.58727341 -0.08652474 11.44966954 -0.98344510 -0.67525762
42+
0.57000000 131.99152801 -20.74361375 -0.99169083 86.98013948 513.80241544 -172.03990353 151.37904080 40.86423191 -36.37573245 -68.09250798 -0.07012411 10.96803118 -1.08851238 -0.68300100
43+
0.57500000 111.26422672 -21.23895155 -0.35085365 67.71029774 565.13992604 -179.75112391 137.58704540 36.19930016 -33.37105233 -59.35488034 -0.05301154 10.51108640 -1.31314295 -0.68680130
44+
0.58000000 91.59627073 -23.03336829 1.22224382 48.07036721 608.68646517 -183.49853938 124.55443985 30.92952308 -29.74503408 -49.32955155 -0.03553373 10.05580730 -1.63867904 -0.68516756
45+
0.58500000 72.23897420 -25.75001745 3.15884470 26.37476016 644.33076188 -184.24248676 111.51588368 25.11604298 -25.62984370 -37.97087331 -0.01795615 9.56248832 -2.03521432 -0.67615005
46+
0.59000000 52.06372446 -29.00714707 4.82053487 0.30377137 672.18764006 -183.03409587 97.40682547 18.71026959 -21.11723530 -25.24497596 -0.00047081 8.97810874 -2.46409063 -0.65742997
47+
0.59500000 29.69727497 -32.42730212 5.51832482 -32.92147052 692.24294779 -180.88650949 80.95656970 11.57922601 -16.25991587 -11.14197925 0.01678352 8.24179366 -2.88131816 -0.62651705
48+
0.60000000 3.71077962 -35.63264145 4.54354026 -76.18186351 704.01690598 -178.64297520 60.82095084 3.55328861 -11.08686956 4.31169186 0.03369458 7.29205856 -3.24161865 -0.58104413
49+
0.60500000 -27.14731538 -38.23451106 1.22185606 -131.92714977 706.35179630 -176.85300214 35.75645770 -5.50969946 -5.62828319 21.03933999 0.05028233 6.07535390 -3.50278406 -0.51913166
50+
0.61000000 -63.72274379 -39.82621582 -5.01344424 -201.58744296 697.45493262 -175.70220548 4.80858053 -15.65754305 0.05739990 38.89859953 0.06687532 4.55473094 -3.62978492 -0.43976290
51+
0.61500000 -106.23261794 -39.99453941 -14.52370748 -284.99399737 675.19244421 -174.98409770 -32.48095276 -26.78403729 5.86182336 57.66276189 0.08353656 2.71809909 -3.59851322 -0.34313229
52+
0.62000000 -154.12191766 -38.35444692 -27.37075995 -380.03146157 637.63975114 -174.15814504 -75.90599012 -38.59624834 11.61833762 77.00395798 0.10021544 0.58416052 -3.39845419 -0.23087911
53+
0.62500000 -206.00381785 -34.61431706 -43.23933932 -482.57784793 583.76019026 -172.46953763 -124.47785834 -50.61836103 17.11083934 96.47646747 0.11701133 -1.79409240 -3.03433186 -0.10620415
54+
0.63000000 -259.74477052 -28.64864754 -61.41794720 -586.90073460 514.02149579 -169.13471676 -176.42671914 -62.23812269 22.09863906 115.51902276 0.13305288 -4.33125019 -2.52578063 0.02626607
55+
0.63500000 -312.56292345 -20.59924874 -80.80164636 -686.13678064 430.85419725 -163.49081708 -229.22057267 -72.78208873 26.35134698 133.44652428 0.14682939 -6.91181761 -1.90669411 0.16062290
56+
0.64000000 -361.48827873 -10.86340639 -100.07282224 -773.61390687 338.51393469 -155.21533920 -279.95283576 -81.62840157 29.68552969 149.52491181 0.15742782 -9.40560538 -1.21998295 0.29040708
57+
0.64500000 -403.24612630 -0.22056801 -117.67628900 -842.70116769 243.06901078 -144.24010793 -325.22400986 -88.26709970 31.98898265 162.90788363 0.16372305 -11.66448238 -0.51810446 0.40846797
58+
0.65000000 -435.57533553 10.54633117 -132.40766179 -889.84821395 150.76602701 -131.11333006 -362.43414612 -92.43244606 33.23781555 172.97262737 0.16636872 -13.57134313 0.15322053 0.50921227
59+
0.65500000 -455.15976638 20.04600010 -142.61666781 -909.59448531 69.33674854 -116.08302599 -387.87365265 -93.96583248 33.47276266 178.73716969 0.16487968 -14.96987937 0.73482611 0.58538120
60+
0.66000000 -463.31093354 28.14887772 -148.58564101 -907.20486645 1.75412593 -100.88003233 -402.26285830 -93.15380880 32.82582440 180.51633620 0.16045460 -15.87234089 1.21728631 0.63753599
61+
0.66500000 -452.43318581 31.86512176 -147.01870582 -867.77712960 -40.75557681 -83.99915684 -397.80658321 -89.79462933 31.36155165 175.94606591 0.14987362 -15.98002604 1.50348546 0.65221909
62+
0.67000000 -455.80000193 40.76548941 -151.23903728 -865.64484918 -90.19076316 -76.29038405 -406.27855111 -86.49341492 29.69691121 175.28193499 0.14796603 -16.46703168 1.89931834 0.68260062

0 commit comments

Comments
 (0)