Skip to content

Commit

Permalink
New script to scale the muscles (Fmax and MaxControl) using matlab's …
Browse files Browse the repository at this point in the history
…optimizer (fmincon) for now
  • Loading branch information
martins055 committed Dec 9, 2021
1 parent dcbfdf0 commit d4aa8a0
Show file tree
Hide file tree
Showing 535 changed files with 1,916,280 additions and 343 deletions.
343 changes: 0 additions & 343 deletions Code/VirtualPatients/Testings_to_opensim_model/2.ScaleMuscles.py

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<?xml version="1.0"?>
<VTKFile type="PolyData" version="0.1" byte_order="LittleEndian" header_type="UInt32" compressor="vtkZLibDataCompressor">
<PolyData>
<Piece NumberOfPoints="63" NumberOfVerts="0" NumberOfLines="0" NumberOfStrips="0" NumberOfPolys="56">
<PointData>
</PointData>
<CellData>
</CellData>
<Points>
<DataArray type="Float32" Name="Array 000000000A123FF0" NumberOfComponents="3" format="ascii" RangeMin="0.019999999553" RangeMax="0.50039984013">
0.019999999553 0.5 0 0.019999999553 0 0
-0.0099999997765 0.5 -0.017320508137 -0.0099999997765 0 -0.017320508137
-0.0099999997765 0.5 0.017320508137 -0.0099999997765 0 0.017320508137
0.019999999553 0.5 0 -0.0099999997765 0.5 -0.017320508137
-0.0099999997765 0.5 0.017320508137 -0.0099999997765 0 0.017320508137
-0.0099999997765 0 -0.017320508137 0.019999999553 0 0
0.13330000639 0 0 -0.066700004041 -0.10000000149 1.2246468526e-17
-0.066700004041 -0.099211469293 -0.012533322908 -0.066700004041 -0.09685831517 -0.024868989363
-0.066700004041 -0.092977650464 -0.036812454462 -0.066700004041 -0.087630666792 -0.048175368458
-0.066700004041 -0.080901697278 -0.058778524399 -0.066700004041 -0.07289686054 -0.068454712629
-0.066700004041 -0.063742399216 -0.077051326632 -0.066700004041 -0.05358267948 -0.084432795644
-0.066700004041 -0.042577929795 -0.090482704341 -0.066700004041 -0.030901700258 -0.095105648041
-0.066700004041 -0.01873813197 -0.098228722811 -0.066700004041 -0.0062790517695 -0.099802672863
-0.066700004041 0.0062790517695 -0.099802672863 -0.066700004041 0.01873813197 -0.098228722811
-0.066700004041 0.030901700258 -0.095105648041 -0.066700004041 0.042577929795 -0.090482704341
-0.066700004041 0.05358267948 -0.084432795644 -0.066700004041 0.063742399216 -0.077051326632
-0.066700004041 0.07289686054 -0.068454712629 -0.066700004041 0.080901697278 -0.058778524399
-0.066700004041 0.087630666792 -0.048175368458 -0.066700004041 0.092977650464 -0.036812454462
-0.066700004041 0.09685831517 -0.024868989363 -0.066700004041 0.099211469293 -0.012533322908
-0.066700004041 0.10000000149 4.102067297e-11 -0.066700004041 0.099211469293 0.012533323839
-0.066700004041 0.09685831517 0.024868989363 -0.066700004041 0.092977650464 0.036812454462
-0.066700004041 0.087630666792 0.048175368458 -0.066700004041 0.080901697278 0.058778524399
-0.066700004041 0.07289686054 0.068454712629 -0.066700004041 0.063742399216 0.077051326632
-0.066700004041 0.05358267948 0.084432795644 -0.066700004041 0.042577929795 0.090482704341
-0.066700004041 0.030901700258 0.095105648041 -0.066700004041 0.01873813197 0.098228722811
-0.066700004041 0.0062790517695 0.099802672863 -0.066700004041 -0.0062790522352 0.099802672863
-0.066700004041 -0.01873813197 0.098228722811 -0.066700004041 -0.030901700258 0.095105648041
-0.066700004041 -0.042577929795 0.090482704341 -0.066700004041 -0.05358267948 0.084432795644
-0.066700004041 -0.063742399216 0.077051326632 -0.066700004041 -0.07289686054 0.068454712629
-0.066700004041 -0.080901697278 0.058778524399 -0.066700004041 -0.087630666792 0.048175368458
-0.066700004041 -0.092977650464 0.036812454462 -0.066700004041 -0.09685831517 0.024868989363
-0.066700004041 -0.099211469293 0.012533322908
</DataArray>
</Points>
<Verts>
<DataArray type="Int64" Name="connectivity" format="ascii" RangeMin="1e+299" RangeMax="-1e+299">
</DataArray>
<DataArray type="Int64" Name="offsets" format="ascii" RangeMin="1e+299" RangeMax="-1e+299">
</DataArray>
</Verts>
<Lines>
<DataArray type="Int64" Name="connectivity" format="ascii" RangeMin="1e+299" RangeMax="-1e+299">
</DataArray>
<DataArray type="Int64" Name="offsets" format="ascii" RangeMin="1e+299" RangeMax="-1e+299">
</DataArray>
</Lines>
<Strips>
<DataArray type="Int64" Name="connectivity" format="ascii" RangeMin="1e+299" RangeMax="-1e+299">
</DataArray>
<DataArray type="Int64" Name="offsets" format="ascii" RangeMin="1e+299" RangeMax="-1e+299">
</DataArray>
</Strips>
<Polys>
<DataArray type="Int64" Name="connectivity" format="ascii" RangeMin="0" RangeMax="62">
0 1 3 2 2 3
5 4 4 5 1 0
6 7 8 9 10 11
62 61 60 59 58 57
56 55 54 53 52 51
50 49 48 47 46 45
44 43 42 41 40 39
38 37 36 35 34 33
32 31 30 29 28 27
26 25 24 23 22 21
20 19 18 17 16 15
14 13 12 13 14 12
14 15 12 15 16 12
16 17 12 17 18 12
18 19 12 19 20 12
20 21 12 21 22 12
22 23 12 23 24 12
24 25 12 25 26 12
26 27 12 27 28 12
28 29 12 29 30 12
30 31 12 31 32 12
32 33 12 33 34 12
34 35 12 35 36 12
36 37 12 37 38 12
38 39 12 39 40 12
40 41 12 41 42 12
42 43 12 43 44 12
44 45 12 45 46 12
46 47 12 47 48 12
48 49 12 49 50 12
50 51 12 51 52 12
52 53 12 53 54 12
54 55 12 55 56 12
56 57 12 57 58 12
58 59 12 59 60 12
60 61 12 61 62 12
62 13
</DataArray>
<DataArray type="Int64" Name="offsets" format="ascii" RangeMin="4" RangeMax="218">
4 8 12 15 18 68
71 74 77 80 83 86
89 92 95 98 101 104
107 110 113 116 119 122
125 128 131 134 137 140
143 146 149 152 155 158
161 164 167 170 173 176
179 182 185 188 191 194
197 200 203 206 209 212
215 218
</DataArray>
</Polys>
</Piece>
</PolyData>
</VTKFile>
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0"?>
<VTKFile type="PolyData" version="0.1" byte_order="LittleEndian" compressor="vtkZLibDataCompressor">
<PolyData>
<Piece NumberOfPoints="24" NumberOfVerts="0" NumberOfLines="0" NumberOfStrips="0" NumberOfPolys="6">
<PointData Normals="Normals">
<DataArray type="Float32" Name="Normals" NumberOfComponents="3" format="ascii">
-1 0 0 -1 0 0
-1 0 0 -1 0 0
1 0 0 1 0 0
1 0 0 1 0 0
0 -1 0 0 -1 0
0 -1 0 0 -1 0
0 1 0 0 1 0
0 1 0 0 1 0
0 0 -1 0 0 -1
0 0 -1 0 0 -1
0 0 1 0 0 1
0 0 1 0 0 1
</DataArray>
</PointData>
<CellData>
</CellData>
<Points>
<DataArray type="Float32" NumberOfComponents="3" format="ascii">
-.5 -.05 -1.1 -.5 -.05 0.2
-.5 0.00 -1.1 -.5 0.00 0.2
2.2 -.05 -1.1 2.2 -.05 0.2
2.2 0.00 -1.1 2.2 0.00 0.2
-.5 -.05 -1.1 -.5 -.05 0.2
2.2 -.05 -1.1 2.2 -.05 0.2
-.5 0.00 -1.1 -.5 0.00 0.2
2.2 0.00 -1.1 2.2 0.00 0.2
-.5 -.05 -1.1 2.2 -.05 -1.1
-.5 0.00 -1.1 2.2 0.00 -1.1
-.5 -.05 0.2 2.2 -.05 0.2
-.5 0.00 0.2 2.2 0.00 0.2
</DataArray>
</Points>
<Verts>
<DataArray type="Int32" Name="connectivity" format="ascii">
</DataArray>
<DataArray type="Int32" Name="offsets" format="ascii">
</DataArray>
</Verts>
<Lines>
<DataArray type="Int32" Name="connectivity" format="ascii">
</DataArray>
<DataArray type="Int32" Name="offsets" format="ascii">
</DataArray>
</Lines>
<Strips>
<DataArray type="Int32" Name="connectivity" format="ascii">
</DataArray>
<DataArray type="Int32" Name="offsets" format="ascii">
</DataArray>
</Strips>
<Polys>
<DataArray type="Int32" Name="connectivity" format="ascii">
0 1 3 2 4 6
7 5 8 10 11 9
12 13 15 14 16 18
19 17 20 21 23 22
</DataArray>
<DataArray type="Int32" Name="offsets" format="ascii">
4 8 12 16 20 24
</DataArray>
</Polys>
</Piece>
</PolyData>
</VTKFile>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Fixing missing polygons

(1) Download Paraview and open .vtp file.

(3) Use hotkey (S) to switch on polygon selection, select incorrect polygons.

(4) Open Paraview Selection Display Inspector, select the Point Labels and ID. The selected Polygons will now show their coordinates.

(5) Open the .vtp file in a text editor and search for the three numbers seen in Paraview. Switch the 1st and 3rd numbers.

36 120 210 -> 210 10 210

There may be one or two sets of with these three numbers, change all.

36 120 210 -> 210 120 210
210 36 120 -> 120 36 210
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0"?>
<VTKFile type="PolyData" version="0.1" byte_order="LittleEndian" compressor="vtkZLibDataCompressor">
<PolyData>
<Piece NumberOfPoints="24" NumberOfVerts="0" NumberOfLines="0" NumberOfStrips="0" NumberOfPolys="6">
<PointData Normals="Normals">
<DataArray type="Float32" Name="Normals" NumberOfComponents="3" format="ascii">
-1 0 0
-1 0 0
-1 0 0
-1 0 0
1 0 0
1 0 0
1 0 0
1 0 0
0 -1 0
0 -1 0
0 -1 0
0 -1 0
0 1 0
0 1 0
0 1 0
0 1 0
0 0 -1
0 0 -1
0 0 -1
0 0 -1
0 0 1
0 0 1
0 0 1
0 0 1
</DataArray>
</PointData>
<CellData>
</CellData>
<Points>
<DataArray type="Float32" NumberOfComponents="3" format="ascii">
-0.2500 0 0.3000
-0.2500 0 0.4000
-0.2500 0.1000 0.3000
-0.2500 0.1000 0.4000
0.2500 0 0.3000
0.2500 0 0.4000
0.2500 0.1000 0.3000
0.2500 0.1000 0.4000
-0.2500 0 0.3000
-0.2500 0 0.4000
0.2500 0 0.3000
0.2500 0 0.4000
-0.2500 0.1000 0.3000
-0.2500 0.1000 0.4000
0.2500 0.1000 0.3000
0.2500 0.1000 0.4000
-0.2500 0 0.3000
0.2500 0 0.3000
-0.2500 0.1000 0.3000
0.2500 0.1000 0.3000
-0.2500 0 0.4000
0.2500 0 0.4000
-0.2500 0.1000 0.4000
0.2500 0.1000 0.4000
</DataArray>
</Points>
<Verts>
<DataArray type="Int32" Name="connectivity" format="ascii">
</DataArray>
<DataArray type="Int32" Name="offsets" format="ascii">
</DataArray>
</Verts>
<Lines>
<DataArray type="Int32" Name="connectivity" format="ascii">
</DataArray>
<DataArray type="Int32" Name="offsets" format="ascii">
</DataArray>
</Lines>
<Strips>
<DataArray type="Int32" Name="connectivity" format="ascii">
</DataArray>
<DataArray type="Int32" Name="offsets" format="ascii">
</DataArray>
</Strips>
<Polys>
<DataArray type="Int32" Name="connectivity" format="ascii">
0 1 3 2 4 6
7 5 8 10 11 9
12 13 15 14 16 18
19 17 20 21 23 22
</DataArray>
<DataArray type="Int32" Name="offsets" format="ascii">
4 8 12 16 20 24
</DataArray>
</Polys>
</Piece>
</PolyData>
</VTKFile>
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0"?>
<VTKFile type="PolyData" version="0.1" byte_order="LittleEndian" compressor="vtkZLibDataCompressor">
<PolyData>
<Piece NumberOfPoints="24" NumberOfVerts="0" NumberOfLines="0" NumberOfStrips="0" NumberOfPolys="6">
<PointData Normals="Normals">
<DataArray type="Float32" Name="Normals" NumberOfComponents="3" format="ascii">
-1 0 0
-1 0 0
-1 0 0
-1 0 0
1 0 0
1 0 0
1 0 0
1 0 0
0 -1 0
0 -1 0
0 -1 0
0 -1 0
0 1 0
0 1 0
0 1 0
0 1 0
0 0 -1
0 0 -1
0 0 -1
0 0 -1
0 0 1
0 0 1
0 0 1
0 0 1
</DataArray>
</PointData>
<CellData>
</CellData>
<Points>
<DataArray type="Float32" NumberOfComponents="3" format="ascii">
-0.2500 0 -0.4000
-0.2500 0 -0.3000
-0.2500 0.1000 -0.4000
-0.2500 0.1000 -0.3000
0.2500 0 -0.4000
0.2500 0 -0.3000
0.2500 0.1000 -0.4000
0.2500 0.1000 -0.3000
-0.2500 0 -0.4000
-0.2500 0 -0.3000
0.2500 0 -0.4000
0.2500 0 -0.3000
-0.2500 0.1000 -0.4000
-0.2500 0.1000 -0.3000
0.2500 0.1000 -0.4000
0.2500 0.1000 -0.3000
-0.2500 0 -0.4000
0.2500 0 -0.4000
-0.2500 0.1000 -0.4000
0.2500 0.1000 -0.4000
-0.2500 0 -0.3000
0.2500 0 -0.3000
-0.2500 0.1000 -0.3000
0.2500 0.1000 -0.3000
</DataArray>
</Points>
<Verts>
<DataArray type="Int32" Name="connectivity" format="ascii">
</DataArray>
<DataArray type="Int32" Name="offsets" format="ascii">
</DataArray>
</Verts>
<Lines>
<DataArray type="Int32" Name="connectivity" format="ascii">
</DataArray>
<DataArray type="Int32" Name="offsets" format="ascii">
</DataArray>
</Lines>
<Strips>
<DataArray type="Int32" Name="connectivity" format="ascii">
</DataArray>
<DataArray type="Int32" Name="offsets" format="ascii">
</DataArray>
</Strips>
<Polys>
<DataArray type="Int32" Name="connectivity" format="ascii">
0 1 3 2 4 6
7 5 8 10 11 9
12 13 15 14 16 18
19 17 20 21 23 22
</DataArray>
<DataArray type="Int32" Name="offsets" format="ascii">
4 8 12 16 20 24
</DataArray>
</Polys>
</Piece>
</PolyData>
</VTKFile>
Loading

0 comments on commit d4aa8a0

Please sign in to comment.