diff --git a/examples-gallery/intermediate/crane_moving_a_load_150_nodes_solution.csv b/examples-gallery/intermediate/crane_moving_a_load_150_nodes_solution.csv new file mode 100644 index 00000000..6d4f525c --- /dev/null +++ b/examples-gallery/intermediate/crane_moving_a_load_150_nodes_solution.csv @@ -0,0 +1,1651 @@ +0.000000000000 +0.030347911312 +0.089065228599 +0.173043379683 +0.278087963028 +0.399230567656 +0.531265380583 +0.669317628468 +0.809248009526 +0.947818249619 +1.082661540663 +1.212146414581 +1.335208904999 +1.451196085934 +1.559738111040 +1.660651081037 +1.753866757906 +1.839383538139 +1.917233568349 +1.987462042991 +2.050115961549 +2.105240743032 +2.152884078824 +2.193107291302 +2.226005292715 +2.251736990874 +2.270568527347 +2.282931694043 +2.289498528009 +2.291269296300 +2.289663668038 +2.286593889896 +2.284487897589 +2.286228298789 +2.294990031358 +2.313995063992 +2.346238220019 +2.394248546774 +2.459928093243 +2.544473016689 +2.648355938233 +2.771344405811 +2.912542421712 +3.070457361480 +3.243101993442 +3.428135835221 +3.623035387759 +3.825268901027 +4.032447544395 +4.242432889483 +4.453394565165 +4.663824193256 +4.872518147038 +5.078542472374 +5.281190796469 +5.479942534570 +5.674425576171 +5.864385392349 +6.049661141352 +6.230168648692 +6.405889868070 +6.576868402181 +6.743210741807 +6.905092967781 +7.062772669277 +7.216605678402 +7.367066811925 +7.514773052195 +7.638954697885 +7.714738947951 +7.738266918241 +7.708168237279 +7.631364618893 +7.526120079789 +7.414859924781 +7.314362032257 +7.233240528123 +7.174368564671 +7.137641001070 +7.121693603728 +7.149204043420 +7.216336661485 +7.319846344092 +7.434058907849 +7.577128648092 +7.729920906464 +7.892390110051 +8.065176314711 +8.247837088483 +8.440602585674 +8.643780433651 +8.859791703693 +9.087036132370 +9.325803590221 +9.597738871631 +9.882421446448 +10.225465756758 +10.634165147219 +11.044158754928 +11.436907253150 +11.797047092784 +12.115945497171 +12.390466316325 +12.620349652550 +12.806272217667 +12.948839825577 +13.048256138175 +13.104523700266 +13.118237833892 +13.092027337026 +13.032098012573 +12.948404426704 +12.852555346396 +12.754902730354 +12.662889219765 +12.581004144330 +12.511518477329 +12.455289108519 +12.412365199613 +12.382380107264 +12.364785878260 +12.358987578409 +12.364417998388 +12.380578076517 +12.407058013514 +12.443547674731 +12.489841095690 +12.545837664118 +12.611541150742 +12.687056753109 +12.772585378975 +12.868413234021 +12.974893042747 +13.092410443285 +13.221324636017 +13.361865713453 +13.513962938521 +13.676973741932 +13.849298728600 +14.027935407059 +14.208162627628 +14.383671900926 +14.547335720727 +14.692357992518 +14.813227792330 +14.906102939666 +14.968700979826 +15.000000000000 +15.000000000000 +15.000000000000 +0.000000000000 +-0.006050892397 +-0.017720368805 +-0.034333636070 +-0.054985079256 +-0.078605081991 +-0.104072767500 +-0.130334680571 +-0.156489099583 +-0.181820776670 +-0.205795362295 +-0.228031902161 +-0.248268862053 +-0.266332528373 +-0.282111265256 +-0.295536068656 +-0.306566572857 +-0.315181346567 +-0.321371420966 +-0.325136234220 +-0.326481432949 +-0.325418201144 +-0.321963987692 +-0.316144684050 +-0.307998471887 +-0.297581714165 +-0.284977374830 +-0.270306447925 +-0.253742608170 +-0.235529528178 +-0.215998795473 +-0.195584109067 +-0.174825182658 +-0.154354333905 +-0.134862169199 +-0.117046085157 +-0.101552709890 +-0.088927621462 +-0.079581102011 +-0.073771091873 +-0.071599119508 +-0.073014089794 +-0.077821243459 +-0.085696708484 +-0.096209538732 +-0.108851982566 +-0.123075700698 +-0.138328823615 +-0.154088007424 +-0.169881346827 +-0.185300905755 +-0.200006156812 +-0.213720939048 +-0.226226695800 +-0.237354225729 +-0.246975449768 +-0.254996049637 +-0.261349372132 +-0.265991713362 +-0.268898954012 +-0.270064462097 +-0.269498174765 +-0.267226787478 +-0.263294997063 +-0.257767747549 +-0.250733397065 +-0.242307641431 +-0.232637875988 +-0.217711054787 +-0.192695901611 +-0.156878124953 +-0.110062656441 +-0.053754722065 +0.008215978139 +0.071168422408 +0.131584165906 +0.187619938353 +0.238606183374 +0.284479812454 +0.325433870863 +0.357171388680 +0.380410913369 +0.395753705150 +0.407913528340 +0.413554553539 +0.416175783860 +0.415786345085 +0.412276086158 +0.405739360272 +0.396153411491 +0.383487427945 +0.367323328583 +0.348000193352 +0.325511568543 +0.295782449896 +0.262793765092 +0.217745050413 +0.159244575754 +0.100179475205 +0.044423638868 +-0.004795815571 +-0.045635498253 +-0.077388848276 +-0.099952872084 +-0.113433702017 +-0.117942483621 +-0.113528729026 +-0.100221319961 +-0.078189396504 +-0.048034327453 +-0.011101821756 +0.030487731439 +0.074273837607 +0.118056496938 +0.160235891876 +0.199820445698 +0.236275280881 +0.269357375822 +0.298992022980 +0.325193554626 +0.348018351756 +0.367538256093 +0.383826031733 +0.396947686319 +0.406958602436 +0.413901739368 +0.417806936183 +0.418690801173 +0.416556953872 +0.411396586502 +0.403189497478 +0.391905980426 +0.377510299451 +0.359967043356 +0.339252557688 +0.315375016618 +0.288408391474 +0.258546563103 +0.226180777561 +0.191989969547 +0.157004870864 +0.122580846763 +0.090239575173 +0.061431079032 +0.037335102704 +0.018779412067 +0.006259804035 +0.000000000000 +0.000000000000 +0.000000000000 +0.000000000000 +0.000093633947 +0.000468021499 +0.001408924381 +0.003301078835 +0.006609767557 +0.011840390179 +0.019487669199 +0.029992133810 +0.043715073036 +0.060932522534 +0.081842351982 +0.106577563416 +0.135220844024 +0.167817740574 +0.204387481222 +0.244931373599 +0.289439089181 +0.337893239625 +0.390272616238 +0.446554381702 +0.506715410325 +0.570732881750 +0.638584143988 +0.710245771448 +0.785691650385 +0.864889833770 +0.947797845287 +1.034356139868 +1.124479663344 +1.218048061429 +1.314896186325 +1.414807959297 +1.517517590744 +1.622721366333 +1.730099978457 +1.839346977572 +1.950196249840 +2.062442449543 +2.175952028895 +2.290666135761 +2.406598238971 +2.523828832845 +2.642498085072 +2.762796074714 +2.884950086131 +3.009209295486 +3.135828426200 +3.265052664225 +3.397105863899 +3.532183083312 +3.670447368873 +3.812029938203 +3.957032623344 +4.105531514318 +4.257580995472 +4.413217646114 +4.572463706575 +4.735329969710 +4.901818052966 +5.071922053930 +5.245629609342 +5.422922377206 +5.603775954237 +5.788159235395 +5.976033227497 +6.167349355504 +6.362047359284 +6.558978310111 +6.757210986616 +6.957089743072 +7.158965345414 +7.362720429903 +7.567199508319 +7.770401726134 +7.970385921482 +8.165846186385 +8.356111209426 +8.540932047260 +8.720293172872 +8.897331739299 +9.072846855493 +9.247365077628 +9.417533483457 +9.586462438110 +9.751249058656 +9.911937124444 +10.068655013116 +10.221328090538 +10.369965222920 +10.514564724930 +10.655384731586 +10.792128928615 +10.924771251997 +11.055180925555 +11.181318504918 +11.305608109601 +11.427027076221 +11.544218722999 +11.658952397816 +11.773068106848 +11.887847198016 +12.003908196326 +12.121417032232 +12.240319237519 +12.360493649038 +12.481831079091 +12.604255557851 +12.727689077343 +12.851948046974 +12.976590044041 +13.100819469661 +13.223583179207 +13.343815009312 +13.460644625142 +13.573470906444 +13.681933601234 +13.785849304397 +13.885150696965 +13.979841117549 +14.069964023857 +14.155583515374 +14.236772229635 +14.313603904374 +14.386148811824 +14.454470930730 +14.518626154593 +14.578661109021 +14.634612325847 +14.686505640087 +14.734355770432 +14.778166144287 +14.817929169513 +14.853627388614 +14.885236357640 +14.912730782833 +14.936096510707 +14.955352211918 +14.970584835306 +14.981998798413 +14.989965743777 +14.995042364481 +14.997921481549 +14.999320234776 +14.999859940730 +14.999994481042 +14.999999795591 +15.000000000000 +15.000000000000 +15.000000000000 +-5.000000000000 +-4.999908467032 +-4.999214991866 +-4.997053293067 +-4.992443506769 +-4.984561054630 +-4.972946579177 +-4.957592260769 +-4.938902740504 +-4.917580446327 +-4.894493826078 +-4.870565955418 +-4.846696300211 +-4.823713213146 +-4.802349183710 +-4.783230741649 +-4.766876755905 +-4.753700895633 +-4.744015611912 +-4.738036084188 +-4.735883260770 +-4.737585541254 +-4.743078914545 +-4.752205570518 +-4.764711226684 +-4.780241736527 +-4.798340068235 +-4.818445559089 +-4.839898509834 +-4.861954540350 +-4.883814082423 +-4.904671607037 +-4.923784804897 +-4.940555014099 +-4.954599362413 +-4.965789617884 +-4.974239767877 +-4.980242720750 +-4.984175474745 +-4.986400734152 +-4.987189389346 +-4.986678276546 +-4.984867274645 +-4.981651418730 +-4.976877155851 +-4.970407351715 +-4.962178707830 +-4.952239072548 +-4.940759566897 +-4.928024169971 +-4.914404277804 +-4.900326773265 +-4.886242396660 +-4.872598450368 +-4.859817409358 +-4.848281372583 +-4.838321460709 +-4.830211005518 +-4.824161437105 +-4.820319978470 +-4.818768501478 +-4.819523137868 +-4.822534461701 +-4.827688269789 +-4.834807193071 +-4.843653579072 +-4.853934283111 +-4.865308158473 +-4.881972040257 +-4.907457610949 +-4.938599216478 +-4.969746088440 +-4.992777813975 +-4.999831245207 +-4.987342982740 +-4.956776438046 +-4.912254745652 +-4.858341725483 +-4.799038887078 +-4.737560492229 +-4.684447625804 +-4.642560704993 +-4.613531351564 +-4.589752564999 +-4.578490768833 +-4.573208119160 +-4.573994955906 +-4.581055894118 +-4.594054120796 +-4.612760541584 +-4.636827162565 +-4.666459651404 +-4.700282816618 +-4.737436270452 +-4.782871800441 +-4.828339925015 +-4.881935322963 +-4.936736772559 +-4.974931158150 +-4.995067162084 +-4.999942500493 +-4.994794406772 +-4.985034886524 +-4.975044345569 +-4.967866466026 +-4.965264220215 +-4.967812662776 +-4.974910228907 +-4.984723830741 +-4.994232867467 +-4.999691877049 +-4.997676425568 +-4.986214831641 +-4.965197108645 +-4.935948370191 +-4.900511169878 +-4.861083051927 +-4.819710527111 +-4.778169406665 +-4.737944524857 +-4.700251854080 +-4.666073621288 +-4.636193442117 +-4.611226642536 +-4.591644543303 +-4.577792880688 +-4.569904942640 +-4.568109985744 +-4.572437317281 +-4.582816180948 +-4.599071311820 +-4.620913743160 +-4.647926186530 +-4.679542164730 +-4.715018322620 +-4.753400628663 +-4.793488928000 +-4.833813038118 +-4.872649942989 +-4.908132337792 +-4.938500165797 +-4.962481854505 +-4.979655858806 +-4.990568522907 +-4.996515630035 +-4.999118360117 +-4.999902037454 +-5.000000000000 +-5.000000000000 +-5.000000000000 +0.000000000000 +0.767146709713 +1.484279965654 +2.122833483655 +2.655359232377 +3.062291489894 +3.337629112699 +3.489740254092 +3.537216459924 +3.502834269521 +3.408622952243 +3.273170728718 +3.110823135152 +2.931970615986 +2.743768972097 +2.550918648208 +2.356343376272 +2.161727570192 +1.967924379137 +1.775263631689 +1.583790956095 +1.393466400477 +1.204347406884 +1.016778544958 +0.831608913072 +0.650456216742 +0.476031154017 +0.312521100886 +0.165999070517 +0.044762193165 +-0.040587717089 +-0.077599086702 +-0.053236120682 +0.043994561633 +0.221482600308 +0.480416859791 +0.815055467988 +1.213624352037 +1.660273995524 +2.137160583386 +2.625994278094 +3.108951956060 +3.569260243384 +3.991837369367 +4.364180453723 +4.677359883107 +4.926749288173 +5.112140097615 +5.237145085490 +5.308094020556 +5.332774098069 +5.319324785047 +5.275449711664 +5.207965769952 +5.122625852551 +5.024126384413 +4.916220557161 +4.801880645442 +4.683474911193 +4.562941380391 +4.441951668002 +4.322064162057 +4.204868572937 +4.092124025923 +3.985890921707 +3.888652684597 +3.803417056790 +3.733777756970 +3.139113592302 +1.915704757680 +0.594749497211 +-0.760846564653 +-1.941472760138 +-2.660413794505 +-2.812478953132 +-2.540426152891 +-2.050622012956 +-1.488189173622 +-0.928414126506 +-0.403124724924 +0.695419960739 +1.697005323793 +2.616559394125 +2.887111129096 +3.616574444249 +3.862344168412 +4.106961882166 +4.367759185321 +4.617372515418 +4.872803778685 +5.136011370278 +5.460419775498 +5.744376078068 +6.035659844708 +6.874089430539 +7.196320640916 +8.671612066965 +10.331267593003 +10.363983337236 +9.928054522689 +9.103759733946 +8.061242144244 +6.939447693677 +5.811083444580 +4.699825389098 +3.603881341151 +2.513085540453 +1.422354068381 +0.346671386370 +-0.662559483063 +-1.514917570323 +-2.115640129682 +-2.422911607700 +-2.468502109451 +-2.325954533470 +-2.069923875448 +-1.756486641339 +-1.421388603258 +-1.085047835640 +-0.757975226014 +-0.444753998117 +-0.146571756028 +0.137272340634 +0.408500955412 +0.669370499069 +0.922400334342 +1.170223716713 +1.415503781576 +1.660879164368 +1.908913773078 +2.162027008888 +2.422375066971 +2.691639436907 +2.970652122643 +3.258744820129 +3.552653888633 +3.844774836963 +4.120652660384 +4.356100331404 +4.515649815383 +4.555856178674 +4.436594009726 +4.137159871348 +3.665931322122 +3.055395419999 +2.347735333760 +1.582378439458 +0.791189222123 +0.000000000000 +-0.000000000000 +0.000000000000 +-0.152956892003 +-0.294985718745 +-0.419956852666 +-0.522035487975 +-0.597075930387 +-0.643782398760 +-0.663859202574 +-0.661141924505 +-0.640344323168 +-0.606039219307 +-0.562104199483 +-0.511558012527 +-0.456620623437 +-0.398861257977 +-0.339357580536 +-0.278833522247 +-0.217767715170 +-0.156475190648 +-0.095168463827 +-0.034004474594 +0.026876801250 +0.087316997128 +0.147102698302 +0.205923227890 +0.263318991869 +0.318617559868 +0.370857591738 +0.418707404210 +0.460397562308 +0.493705717630 +0.516050654857 +0.524752492124 +0.517470349275 +0.492730780238 +0.450362139006 +0.391647772264 +0.319142063784 +0.236265078339 +0.146867773370 +0.054903991127 +-0.035768188065 +-0.121517164039 +-0.199079172843 +-0.265747551817 +-0.319580780723 +-0.359552868491 +-0.385574576719 +-0.398366987527 +-0.399230386361 +-0.389781813155 +-0.371725251452 +-0.346687782202 +-0.316125549672 +-0.281286177630 +-0.243209171432 +-0.202747949815 +-0.160601841674 +-0.117350969018 +-0.073490398597 +-0.029462182209 +0.014314838969 +0.057417041532 +0.099389379681 +0.139720036584 +0.177817141133 +0.212989640200 +0.244436220576 +0.377326190681 +0.632343104439 +0.905416166193 +1.183420244761 +1.423374615250 +1.566520287702 +1.591337209107 +1.527213466624 +1.416494796528 +1.288850811047 +1.159612048747 +1.035253162398 +0.802273741905 +0.587458053295 +0.387841262333 +0.307380901929 +0.142596104097 +0.066260514452 +-0.009844389989 +-0.088733737181 +-0.165237986373 +-0.242317469271 +-0.320175827027 +-0.408602605739 +-0.488457985163 +-0.568476504069 +-0.751504619808 +-0.833901244315 +-1.138759530688 +-1.478798530463 +-1.493071370864 +-1.409418458913 +-1.244189168039 +-1.032361926765 +-0.802673954796 +-0.570382470289 +-0.340773841754 +-0.113974795065 +0.111572664105 +0.336390039307 +0.556931823568 +0.762271965475 +0.933594735261 +1.051317455208 +1.106842804858 +1.106755674330 +1.066227712064 +1.000634274547 +0.921519987861 +0.836262503317 +0.749116531532 +0.662332856620 +0.576974403206 +0.493431993778 +0.411728944458 +0.331694462869 +0.253059964539 +0.175511408260 +0.098717135980 +0.022342694752 +-0.053940250431 +-0.130445842142 +-0.207462097686 +-0.285229282877 +-0.363899814426 +-0.443465484391 +-0.523629101222 +-0.603586087986 +-0.681673197817 +-0.754859309611 +-0.818155346198 +-0.864288998376 +-0.884367397392 +-0.870184328431 +-0.817535672661 +-0.728232753776 +-0.609107782330 +-0.469058212020 +-0.316475687892 +-0.158237844425 +0.000000000000 +-0.000000000000 +0.000000000000 +0.002366916570 +0.009463919148 +0.023784521518 +0.047830641433 +0.083638364447 +0.132221782676 +0.193310995208 +0.265536081896 +0.346893977881 +0.435229614189 +0.528567079853 +0.625266624454 +0.724056369078 +0.823997463219 +0.924424614429 +1.024884820449 +1.125083937897 +1.224843505795 +1.324066951832 +1.422713106970 +1.520774681538 +1.618259393967 +1.715171500292 +1.811491445110 +1.907151276160 +2.002003537406 +2.095782065184 +2.188055388843 +2.278178678976 +2.365259605054 +2.448165858655 +2.525609987091 +2.596335379077 +2.659383357967 +2.714359750753 +2.761589588660 +2.802092493962 +2.837404587575 +2.869340806530 +2.899789337551 +2.930578339094 +2.963402108434 +2.999769092976 +3.040940972511 +3.087858237526 +3.141074277840 +3.200729319219 +3.266582269772 +3.338093900271 +3.414536287674 +3.495100227784 +3.578981139664 +3.665436202912 +3.753814700307 +3.843567947108 +3.934245860392 +4.025485973683 +4.116998913134 +4.208552739037 +4.299957361366 +4.391049460279 +4.481677902770 +4.571689469256 +4.660914750016 +4.749154345421 +4.836166041442 +4.921654457596 +4.978099791247 +5.011005336590 +5.052615607716 +5.103092681248 +5.150602986997 +5.168904396739 +5.136627400820 +5.055280934432 +4.940923200907 +4.809595787281 +4.671975483689 +4.533962681949 +4.475252096593 +4.436741708817 +4.411541819767 +4.301585413464 +4.270254068063 +4.165542480228 +4.061937564409 +3.961577830240 +3.859331464428 +3.757309222216 +3.655244377542 +3.559704773656 +3.456674818387 +3.352986006358 +3.296548185997 +3.188556470483 +3.141842623170 +3.069277479474 +2.962417588050 +2.900283984114 +2.884662796400 +2.901432036888 +2.933836601293 +2.970435622410 +3.005657774129 +3.037817115024 +3.067216365346 +3.094695219806 +3.120202157359 +3.141068217998 +3.150750539594 +3.140321392586 +3.103270432093 +3.039268565137 +2.953266024133 +2.852068123574 +2.741763628438 +2.626822945057 +2.510180545722 +2.393622541120 +2.278163077932 +2.164323947355 +2.052320977563 +1.942181979916 +1.833819351996 +1.727074004549 +1.621741555501 +1.517587727314 +1.414357365526 +1.311780071666 +1.209574842760 +1.107456253214 +1.005145746496 +0.902393942171 +0.799024233875 +0.695015139778 +0.590648268162 +0.486753360871 +0.385056381391 +0.288526750729 +0.201391649651 +0.128328860242 +0.072779479389 +0.035358246725 +0.013642904203 +0.003400964133 +0.000134343300 +0.000005167134 +0.000000000000 +0.000000000000 +0.000000000000 +0.002313807177 +0.017529944216 +0.054644291781 +0.116528032359 +0.199255795918 +0.293595382470 +0.388132637042 +0.472441211180 +0.538993529208 +0.583592873330 +0.604858339632 +0.603386745972 +0.580975719871 +0.540048529849 +0.483283668890 +0.413402630089 +0.333064695985 +0.244828497849 +0.151152907100 +0.054419936349 +-0.043030930820 +-0.138863699781 +-0.230707280940 +-0.316123007006 +-0.392586475005 +-0.457496909043 +-0.508234685331 +-0.542296318463 +-0.557541211504 +-0.552574297618 +-0.527244897215 +-0.483151103859 +-0.423924094090 +-0.355018686087 +-0.282871779123 +-0.213606290623 +-0.151745057445 +-0.099413737446 +-0.056251002412 +-0.019935943230 +0.012920114963 +0.045779234524 +0.081291699414 +0.120685737517 +0.163546311458 +0.208006970128 +0.251258098928 +0.290183561507 +0.321930486373 +0.344289112841 +0.355856822475 +0.356030537309 +0.344897162710 +0.323084295890 +0.291612578008 +0.251770658749 +0.205019348796 +0.152923423803 +0.097105936619 +0.039218859485 +-0.019076002209 +-0.076121455188 +-0.130280033984 +-0.179955006319 +-0.223622503836 +-0.259879772152 +-0.287513396588 +-0.421236306849 +-0.644234507630 +-0.787210031389 +-0.787343158416 +-0.582205222674 +-0.178299471960 +0.315683322091 +0.772673412304 +1.125437249371 +1.362835010554 +1.499081004009 +1.554075594907 +1.342608402349 +1.058834433454 +0.733815673133 +0.601089731912 +0.284680213577 +0.133536943395 +-0.019889975769 +-0.178489236414 +-0.328574402551 +-0.472868429417 +-0.608365726051 +-0.749061972646 +-0.854995575780 +-0.939179951140 +-1.148537603690 +-1.149361542724 +-1.354806028284 +-1.385293086991 +-0.965493042810 +-0.509006007227 +-0.123240765420 +0.130135583909 +0.246705078635 +0.252544912989 +0.181445326438 +0.065780616352 +-0.064420556178 +-0.179415131674 +-0.248072174720 +-0.240373255407 +-0.137995040119 +0.050947393253 +0.289730781757 +0.531294456373 +0.739361376050 +0.895795804270 +0.996679825674 +1.045831324564 +1.050093152718 +1.016820742969 +0.952810493925 +0.863971116837 +0.755323188498 +0.631120802802 +0.495004181398 +0.350147899462 +0.199394470927 +0.045373642455 +-0.109388027269 +-0.262361090727 +-0.410903736865 +-0.552141765629 +-0.682831409368 +-0.799201414588 +-0.896780589578 +-0.970243371587 +-1.013368156310 +-1.019329076091 +-0.981734903628 +-0.896938248764 +-0.767650171902 +-0.606218773886 +-0.434131389037 +-0.275854712793 +-0.150333366233 +-0.065792857970 +-0.019810110952 +-0.002476336656 +-0.000000000000 +0.000000000000 +0.000000000000 +-3.866505843565 +-3.590261814049 +-3.159070593399 +-2.580384804858 +-1.896902488619 +-1.180664895386 +-0.507509522792 +0.068688448076 +0.525730132520 +0.867178214742 +1.110607104144 +1.277726846284 +1.388729420197 +1.460064474043 +1.504157893945 +1.529951491464 +1.543646035262 +1.549377090019 +1.549736101449 +1.546127923302 +1.538981380507 +1.527831583730 +1.511287003314 +1.486889007700 +1.450873209536 +1.397859445944 +1.320544539385 +1.209566807445 +1.053860586415 +0.841976948579 +0.564844311565 +0.219968542771 +-0.184080936198 +-0.625376777705 +-1.071011556026 +-1.484205380584 +-1.832828464657 +-2.094997775687 +-2.259821035436 +-2.324697480326 +-2.292047818860 +-2.167597107528 +-1.960643658186 +-1.685270101319 +-1.360818014925 +-1.010430513509 +-0.657787207924 +-0.323371706209 +-0.021825343033 +0.238844834222 +0.456441030050 +0.632907219133 +0.772564407677 +0.880683660737 +0.962525879307 +1.022795035732 +1.065386275025 +1.093312956836 +1.108725142185 +1.112962964374 +1.106613150827 +1.089554814404 +1.060993647281 +1.019494568364 +0.963033933499 +0.889104579676 +0.794919308263 +3.359246119834 +6.446420127532 +6.902850699742 +7.027498926283 +6.065663099838 +3.618493889137 +0.627332121990 +-1.620945756528 +-2.798791079693 +-3.226636010286 +-3.266949420244 +-3.143593952978 +-5.889347508117 +-5.430197387144 +-5.045993538576 +-2.033909355798 +-4.165496404934 +-1.929641741351 +-1.923810387940 +-1.994196651888 +-1.933905185208 +-1.948446174226 +-1.968134886177 +-2.235287682305 +-2.018616403236 +-2.022740308666 +-4.626658333452 +-2.082855018649 +-7.706330393382 +-8.595642618345 +-0.360794600984 +2.114611958016 +4.176732478864 +5.354654213253 +5.806144948334 +5.871957585550 +5.804139273088 +5.733117533009 +5.701479400268 +5.683024044039 +5.574943936359 +5.190670706022 +4.330765889913 +2.975842269252 +1.403592123722 +-0.002202520527 +-1.024482132690 +-1.658097298763 +-1.999882762895 +-2.155172989465 +-2.202910929597 +-2.193752643491 +-2.157725321196 +-2.111818630766 +-2.065322546088 +-2.023143819795 +-1.987754479828 +-1.960303599837 +-1.941236505505 +-1.930623847274 +-1.928310973454 +-1.933939121961 +-1.946847887725 +-1.965830189415 +-1.988665342026 +-2.011293010983 +-2.026408152392 +-2.021184874424 +-1.973917373158 +-1.850027973336 +-1.600022673922 +-1.166185017203 +-0.507549846949 +0.358525322380 +1.330873898703 +2.257435106017 +3.011288946706 +3.540229373795 +3.857042421842 +3.999999858960 +3.999999883164 +-0.000000000000 +0.000000000000 +19.392243115930 +18.127982913385 +16.141612688701 +13.461400086806 +10.286597295627 +6.960095184904 +3.845126619446 +1.200122628504 +-0.869126839380 +-2.381511575029 +-3.424015792449 +-4.103887775123 +-4.521105923618 +-4.757436859090 +-4.874948062069 +-4.918551992666 +-4.919576631076 +-4.899035021585 +-4.870155872555 +-4.840123314299 +-4.811100675725 +-4.780625993895 +-4.741441142084 +-4.680792440050 +-4.579250727204 +-4.409186898751 +-4.133272895606 +-3.703842822748 +-3.064674553703 +-2.157509363753 +-0.935588289036 +0.615856855146 +2.457836299001 +4.486614036881 +6.545444368546 +8.459129347711 +10.075184576903 +11.290589354653 +12.054930997513 +12.356934770124 +12.208398455248 +11.635858047817 +10.682074573930 +9.412238262825 +7.916675593628 +6.304165699144 +4.686383455277 +3.159926367250 +1.793475720078 +0.623872927033 +-0.339977144617 +-1.109091753891 +-1.705886224284 +-2.157256760379 +-2.489909177380 +-2.727686906838 +-2.890330282100 +-2.993107779527 +-3.046895076709 +-3.058426618359 +-3.030564600504 +-2.962517244163 +-2.850002011370 +-2.685403141064 +-2.458027272130 +-2.154620486067 +-1.760370233529 +-15.032159960493 +-30.925820642650 +-33.391638433613 +-34.267302545698 +-29.844343881051 +-18.173680663605 +-3.843964248575 +6.877060118803 +12.381466074943 +14.217403553523 +14.150218812733 +13.278476792926 +27.769454458148 +25.318477698951 +23.244857684133 +6.839115587103 +18.439667109951 +6.212665949254 +6.183544966699 +6.592539135924 +6.309826166130 +6.456894221097 +6.653467376581 +8.200526161726 +7.177961638913 +7.363188223173 +21.194160332281 +8.145490154675 +37.293010109496 +41.953439990227 +0.827001742746 +-11.019583928201 +-20.836855245698 +-26.353178989338 +-28.357171367707 +-28.523245377663 +-28.090828134436 +-27.703714491837 +-27.573575026989 +-27.571948902083 +-27.191539533513 +-25.511743884655 +-21.546250594167 +-15.185306498524 +-7.767332022510 +-1.152455042206 +3.603374965976 +6.472045962815 +7.923192485177 +8.470743001146 +8.502157218249 +8.267872992366 +7.917732193283 +7.537570660496 +7.175125252857 +6.856226027141 +6.594365260360 +6.396189958287 +6.264579147515 +6.200288144495 +6.202697629420 +6.269918611882 +6.398298190617 +6.581182938258 +6.806573055903 +7.052994904003 +7.282523093482 +7.429551659715 +7.384350838705 +6.973750593376 +5.951740937804 +4.033156035439 +1.016352624439 +-3.014757080350 +-7.569216598490 +-11.911904820886 +-15.433372124348 +-17.888516319042 +-19.346999442006 +-19.999999294798 +-19.999999415822 +-0.000000000000 +0.000000000000 +19.999999458003 +19.999999446575 +19.999999433538 +19.999999419068 +19.999999403451 +19.999999386983 +19.999999369882 +19.999999352267 +19.999999334195 +19.999999315691 +19.999999296762 +19.999999277409 +19.999999257617 +19.999999237361 +19.999999216606 +19.999999195310 +19.999999173427 +19.999999150914 +19.999999127726 +19.999999103831 +19.999999079205 +19.999999053847 +19.999999027780 +19.999999001070 +19.999998973841 +19.999998946291 +19.999998918727 +19.999998891583 +19.999998865451 +19.999998841080 +19.999998819348 +19.999998801151 +19.999998787234 +19.999998777963 +19.999998773126 +19.999998771876 +19.999998772840 +19.999998774347 +19.999998774655 +19.999998772096 +19.999998765118 +19.999998752278 +19.999998732200 +19.999998703562 +19.999998665079 +19.999998615495 +19.999998553554 +19.999998477944 +19.999998387202 +19.999998279584 +19.999998152894 +19.999998004271 +19.999997829902 +19.999997624650 +19.999997381508 +19.999997090794 +19.999996738906 +19.999996306303 +19.999995764129 +19.999995068244 +19.999994148101 +19.999992884422 +19.999991060129 +19.999988238225 +19.999983399516 +19.999973526128 +19.999944223624 +0.181313735466 +-19.999941629647 +-19.999970184250 +-19.999979249845 +-19.999982542232 +-19.999982572355 +-19.999979600078 +-19.999972394473 +-19.999957064473 +-19.999921910043 +-19.999822310482 +-19.999397089063 +18.328895231028 +19.996098615392 +19.995550663318 +-19.995182026928 +11.710898955345 +-19.995952862955 +-19.977952655577 +-18.995080190221 +-19.975396960015 +-19.984198310660 +-19.988660728805 +-17.100861909758 +-19.991303326088 +-19.998274994395 +3.617588930837 +-19.999345693428 +19.998048329764 +19.804927720698 +-19.999911289028 +-19.999974541710 +-19.999989054558 +-19.999993876075 +-19.999995978106 +-19.999997080171 +-19.999997740756 +-19.999998178597 +-19.999998491397 +-19.999998726765 +-19.999998908722 +-19.999999049006 +-19.999999153225 +-19.999999225159 +-19.999999269094 +-19.999999290096 +-19.999999293516 +-19.999999284385 +-19.999999266868 +-19.999999244059 +-19.999999218065 +-19.999999190239 +-19.999999161383 +-19.999999131920 +-19.999999102001 +-19.999999071576 +-19.999999040435 +-19.999999008228 +-19.999998974472 +-19.999998938541 +-19.999998899647 +-19.999998856808 +-19.999998808801 +-19.999998754105 +-19.999998690832 +-19.999998616683 +-19.999998528983 +-19.999998424988 +-19.999998302880 +-19.999998164353 +-19.999998020102 +-19.999997898236 +-19.999997848142 +-19.999997920767 +-19.999998123448 +-19.999998402912 +-19.999998688729 +-19.999998937811 +-19.999999138372 +-19.999999294798 +-19.999999415822 +-0.000000000000 +0.039559462262 diff --git a/examples-gallery/intermediate/plot_crane_moving_a_load.py b/examples-gallery/intermediate/plot_crane_moving_a_load.py index 17fef652..f8b0728c 100644 --- a/examples-gallery/intermediate/plot_crane_moving_a_load.py +++ b/examples-gallery/intermediate/plot_crane_moving_a_load.py @@ -1,14 +1,34 @@ # %% -""" +r""" Crane Moving a Load =================== +Objectives +---------- + +- Show the use of opty's variable node time interval feature to solve a + relatively simple problem. +- Show how to use additional 'pseudo' state variables to enforce + instance constraints on :math:`\dfrac{d^2}{dt^2}(\textrm{state variable})` + +Introduction +------------ + A load is moved by a crane. The load is connected to the crane by a massless rod and a pin joint. The goal is to move the load from the initial position to the final position in the shortest possible time. The load must not over-swing the final position. The load is moved by a force applied to its suspension point. The jib of the crane is extended in the horizontal X direction. +In order to ensure that the load is at rest at its final location, its velocity +**and** its acceleration must be zero at the final time. + + +Notes +----- + +The solution ``opty`` finds may not what one would expect intuitively. + **Constants** - ``l``: length of the rod attaching the load to the crane [m] @@ -22,18 +42,20 @@ - ``q``: angle of the rod [rad] - ``uxc``: velocity of the mover in x-direction [m/s] - ``u``: angular velocity of the rod [rad/s] +- ``h1, h2``: pseudo states to enforce instance constraints **Specifieds** - ``F``: force applied to the mover [N] """ +import os import sympy.physics.mechanics as me import numpy as np import sympy as sm from scipy.interpolate import CubicSpline from opty.direct_collocation import Problem -from opty.utils import parse_free +from opty.utils import parse_free, MathJaxRepr import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib import patches @@ -47,8 +69,8 @@ t = me.dynamicsymbols._t O, P1, P2 = sm.symbols('O P1 P2', cls=me.Point) O.set_vel(N, 0) -xc, xl, yl, q, uxc, uxl, uyl, u, F = \ - me.dynamicsymbols('xc, xl, yl, q, uxc, uxl, uyl, uq, F') +xc, xl, yl, q, uxc, uxl, uyl, u, F, h1, h2 = \ + me.dynamicsymbols('xc, xl, yl, q, uxc, uxl, uyl, uq, F, h1, h2') l, m1, m2, g = sm.symbols('l, m1, m2, g') A.orient_axis(N, q, N.z) @@ -95,13 +117,14 @@ fr, frstar = KM.kanes_equations(bodies, forces) eom = kd.col_join(fr + frstar) eom = eom.col_join(config_constr) -sm.pprint(eom) +eom = eom.col_join(sm.Matrix([h1 - u.diff(t), h2 - uxc.diff(t)])) +MathJaxRepr(eom) # %% # Set up the Optimization Problem and Solve it. #---------------------------------------------- # -state_symbols = tuple((*q_ind, *q_dep, *u_ind, *u_dep)) +state_symbols = tuple((*q_ind, *q_dep, *u_ind, *u_dep, h1, h2)) constant_symbols = (l, m1, m2, g) specified_symbols = (F,) h = sm.symbols('h') @@ -127,13 +150,11 @@ def obj(free): """Minimize h, the time interval between nodes.""" return free[-1] - def obj_grad(free): grad = np.zeros_like(free) grad[-1] = 1.0 return grad - # %% # Starting and final location of the load. starting_location = 0.0 @@ -180,13 +201,12 @@ def obj_grad(free): uxl.subs({t: tf}) - final_state_constraints[uxl], uyl.subs({t: tf}) - final_state_constraints[uyl], u.subs({t: tf}) - final_state_constraints[u], + h1.subs({t: tf}) - 0.0, + h2.subs({t: tf}) - 0.0, ) # %% -# Forcing h > 0.0 sometimes avoids negative 'solutions'. Here it also -# seem to help with the convergence of the optimization: Different bounds, -# e.g.: h :math:`\in (10^{-4}, 1.0)` gives unreasonable results. - +# Forcing h > 0.0 sometimes avoids negative 'solutions'. bounds = { F: (-20., 20.), xl: (starting_location, ending_location), @@ -205,38 +225,40 @@ def obj_grad(free): interval_value, known_parameter_map=par_map, instance_constraints=instance_constraints, + time_symbol=t, bounds=bounds, + backend='numpy', ) # %% -# This initial guess was used to get a solution which forms the actual initial -# guess: -# +# Reasonable initial guess. + i1 = [(ending_location - starting_location)/num_nodes*i for i in range(num_nodes)] i2 = [0.0 for _ in range(num_nodes)] i3 = i1 i4 = [-par_map[l] for _ in range(num_nodes)] i5 = [0.0 for _ in range(5*num_nodes)] -i6 = [0.01] -initial_guess = np.array(i1 + i2 + i3 + i4 + i5 + i6) +i6 = list(np.zeros(2*num_nodes)) +i7 = [0.01] +initial_guess = np.array(i1 + i2 + i3 + i4 + i5 + i6 + i7) # %% -# The initial guess is the solution of some previous run, saved in the file -# 'crane_moving_a_load_solution.npy', to speed up convergence. -# To get this solution, the initial guess above was used, which is now -# overwritten. - -initial_guess = np.load('crane_moving_a_load_solution.npy') -_ = prob.plot_trajectories(initial_guess) - -# %% -# Find the optimal solution. - -solution, info = prob.solve(initial_guess) -print('Message from optimizer:', info['status_msg']) -_ = prob.plot_objective_value() -print('Iterations needed', len(prob.obj_value)) -print(f"Objective value {solution[-1]: .3e}") +# Use the solution of a previous run if available, else the initial guess given +# above is used. +fname = f'crane_moving_a_load_{num_nodes}_nodes_solution.csv' +if os.path.exists(fname): + solution = np.loadtxt(fname) +else: + # Use the the initial_guess given above and plot it. + _ = prob.plot_trajectories(initial_guess) + + # Find the optimal solution. + + solution, info = prob.solve(initial_guess) + print('Message from optimizer:', info['status_msg']) + _ = prob.plot_objective_value() + print('Iterations needed', len(prob.obj_value)) + print(f"Objective value {solution[-1]: .3e}") # %% # Plot the accuracy of the solution. @@ -244,9 +266,7 @@ def obj_grad(free): # %% # Plot the state trajectories. -fig, ax = plt.subplots(9, 1, figsize=(6.00, 1.0*9), sharex=True, - layout='constrained') -_ = prob.plot_trajectories(solution, ax) +_ = prob.plot_trajectories(solution) # %% # Animate the Simulation. @@ -308,10 +328,6 @@ def init_plot(): return fig, ax, line1, recht, load, pfeil - -fig, ax, line1, recht, load, pfeil = init_plot() - - def update(t): message = f'running time {t:0.2f} sec \n The red arrow shows the force.' ax.set_title(message, fontsize=12) @@ -325,14 +341,16 @@ def update(t): pfeil.set_UVC(input_sol(t), 0.25) return line1, recht, load, pfeil -anim = animation.FuncAnimation(fig, update, - frames=np.arange(t0, tf, 1/fps), - interval=1/fps*1000) - # %% # A frame from the animation. fig, ax, line1, recht, load, pfeil = init_plot() -# sphinx_gallery_thumbnail_number = 6 -update(2.0) +# sphinx_gallery_thumbnail_number = 3 +_ = update(2.0) + +# %% +fig, ax, line1, recht, load, pfeil = init_plot() +anim = animation.FuncAnimation(fig, update, + frames=np.arange(t0, tf, 1/fps), + interval=1/fps*1000) plt.show()