は、次のコードを考えてみましょう。 私はヤコビアンを見ましたが、それは "4967757600021511/405648192073033408478945025720320"以上の非常に複雑でした!プログラム、逆計算を最適化するために遅すぎる必要
Matlabにこれらの数値を小数点以下3桁に簡略化させる方法はありますか?
P.Sこれはヤコビ行列のexemple 2行目のためのものである:代わり合理の浮動小数点ビューを取得するdouble
を使用して、可変表現懸念の
[ (667495948725283505644223413159337121101697927362615132085977267803570842210039392837475731450497*cos(t1))/66749594872528440074844428317798503581334516323645399060845050244444366430645017188217565216768000 + (180182749026672061615969125490030497260998891573948681728240766153*cos(t1)*sin(t2))/822752278660603021077484591278675252491367932816789931674304512000 + (23859816081157487611247053147082199287638984338758594710122908873*sin(t3)*(cos(t1) + (4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 + (4967757600021511*cos(t2)*sin(t1))/81129638414606681695789005144064))/822752278660603021077484591278675252491367932816789931674304512000 + (895104220870018647914711647235873838858522473234640872822096410779044699920717183*sin(t1)*sin(t2))/66749594872528440074844428317798503581334516323645399060845050244444366430645017188217565216768000 - (4967757600021511*sin(t5)*(cos(t1)*sin(t2) - (4967757600021511*cos(t1))/81129638414606681695789005144064 + sin(t3)*(cos(t1) + (4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 + (4967757600021511*cos(t2)*sin(t1))/81129638414606681695789005144064) + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064 - (4967757600021511*cos(t4)*(cos(t3)*(cos(t1) + (4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 + (4967757600021511*cos(t2)*sin(t1))/81129638414606681695789005144064) + sin(t3)*(cos(t1)*cos(t2) - sin(t1)*sin(t2))))/81129638414606681695789005144064 + (4967757600021511*sin(t4)*(sin(t3)*(cos(t1) + (4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 + (4967757600021511*cos(t2)*sin(t1))/81129638414606681695789005144064) - cos(t3)*(cos(t1)*cos(t2) - sin(t1)*sin(t2))))/81129638414606681695789005144064))/405648192073033408478945025720320 - (21*cos(t4)*(sin(t3)*(cos(t1) + (4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 + (4967757600021511*cos(t2)*sin(t1))/81129638414606681695789005144064) - cos(t3)*(cos(t1)*cos(t2) - sin(t1)*sin(t2))))/1000 - (17277797851872663442627176416851563336929412302080901873592316727*sin(t4)*(cos(t3)*(cos(t1) + (4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 + (4967757600021511*cos(t2)*sin(t1))/81129638414606681695789005144064) + sin(t3)*(cos(t1)*cos(t2) - sin(t1)*sin(t2))))/822752278660603021077484591278675252491367932816789931674304512000 - (4967757600021511*sin(t4)*(sin(t3)*(cos(t1) + (4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 + (4967757600021511*cos(t2)*sin(t1))/81129638414606681695789005144064) - cos(t3)*(cos(t1)*cos(t2) - sin(t1)*sin(t2))))/405648192073033408478945025720320 + (sin(t5)*(cos(t4)*(sin(t3)*(cos(t1) + (4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 + (4967757600021511*cos(t2)*sin(t1))/81129638414606681695789005144064) - cos(t3)*(cos(t1)*cos(t2) - sin(t1)*sin(t2))) + sin(t4)*(cos(t3)*(cos(t1) + (4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 + (4967757600021511*cos(t2)*sin(t1))/81129638414606681695789005144064) + sin(t3)*(cos(t1)*cos(t2) - sin(t1)*sin(t2)))))/5 + (19*cos(t3)*(cos(t1)*cos(t2) - sin(t1)*sin(t2)))/100, (sin(t5)*(cos(t4)*(sin(t3)*((4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 + (4967757600021511*cos(t2)*sin(t1))/81129638414606681695789005144064) - cos(t3)*(cos(t1)*cos(t2) - sin(t1)*sin(t2))) + sin(t4)*(cos(t3)*((4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 + (4967757600021511*cos(t2)*sin(t1))/81129638414606681695789005144064) + sin(t3)*(cos(t1)*cos(t2) - sin(t1)*sin(t2)))))/5 - (895104220870018647914711647235873838858522473234640872822096410779044699920717183*cos(t1)*cos(t2))/66749594872528440074844428317798503581334516323645399060845050244444366430645017188217565216768000 + (180182749026672061615969125490030497260998891573948681728240766153*cos(t2)*sin(t1))/822752278660603021077484591278675252491367932816789931674304512000 - (4967757600021511*sin(t5)*(cos(t2)*sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + sin(t3)*((4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 + (4967757600021511*cos(t2)*sin(t1))/81129638414606681695789005144064) - (4967757600021511*cos(t4)*(cos(t3)*((4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 + (4967757600021511*cos(t2)*sin(t1))/81129638414606681695789005144064) + sin(t3)*(cos(t1)*cos(t2) - sin(t1)*sin(t2))))/81129638414606681695789005144064 + (4967757600021511*sin(t4)*(sin(t3)*((4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 + (4967757600021511*cos(t2)*sin(t1))/81129638414606681695789005144064) - cos(t3)*(cos(t1)*cos(t2) - sin(t1)*sin(t2))))/81129638414606681695789005144064))/405648192073033408478945025720320 + (23859816081157487611247053147082199287638984338758594710122908873*sin(t3)*((4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 + (4967757600021511*cos(t2)*sin(t1))/81129638414606681695789005144064))/822752278660603021077484591278675252491367932816789931674304512000 - (21*cos(t4)*(sin(t3)*((4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 + (4967757600021511*cos(t2)*sin(t1))/81129638414606681695789005144064) - cos(t3)*(cos(t1)*cos(t2) - sin(t1)*sin(t2))))/1000 - (17277797851872663442627176416851563336929412302080901873592316727*sin(t4)*(cos(t3)*((4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 + (4967757600021511*cos(t2)*sin(t1))/81129638414606681695789005144064) + sin(t3)*(cos(t1)*cos(t2) - sin(t1)*sin(t2))))/822752278660603021077484591278675252491367932816789931674304512000 - (4967757600021511*sin(t4)*(sin(t3)*((4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 + (4967757600021511*cos(t2)*sin(t1))/81129638414606681695789005144064) - cos(t3)*(cos(t1)*cos(t2) - sin(t1)*sin(t2))))/405648192073033408478945025720320 + (19*cos(t3)*(cos(t1)*cos(t2) - sin(t1)*sin(t2)))/100, (23859816081157487611247053147082199287638984338758594710122908873*cos(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064))/822752278660603021077484591278675252491367932816789931674304512000 - (4967757600021511*sin(t5)*(cos(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) + (4967757600021511*cos(t4)*(sin(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) - cos(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1))))/81129638414606681695789005144064 + (4967757600021511*sin(t4)*(cos(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) + sin(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1))))/81129638414606681695789005144064))/405648192073033408478945025720320 - (21*cos(t4)*(cos(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) + sin(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1))))/1000 - (4967757600021511*sin(t4)*(cos(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) + sin(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1))))/405648192073033408478945025720320 + (17277797851872663442627176416851563336929412302080901873592316727*sin(t4)*(sin(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) - cos(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1))))/822752278660603021077484591278675252491367932816789931674304512000 - (19*sin(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1)))/100 + (sin(t5)*(cos(t4)*(cos(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) + sin(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1))) - sin(t4)*(sin(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) - cos(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1)))))/5, (21*sin(t4)*(sin(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) - cos(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1))))/1000 - (17277797851872663442627176416851563336929412302080901873592316727*cos(t4)*(cos(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) + sin(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1))))/822752278660603021077484591278675252491367932816789931674304512000 - (4967757600021511*cos(t4)*(sin(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) - cos(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1))))/405648192073033408478945025720320 - (4967757600021511*sin(t5)*((4967757600021511*cos(t4)*(sin(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) - cos(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1))))/81129638414606681695789005144064 + (4967757600021511*sin(t4)*(cos(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) + sin(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1))))/81129638414606681695789005144064))/405648192073033408478945025720320 + (sin(t5)*(cos(t4)*(cos(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) + sin(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1))) - sin(t4)*(sin(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) - cos(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1)))))/5, (4967757600021511*cos(t5)*((4967757600021511*sin(t1))/81129638414606681695789005144064 + (4967757600021511*cos(t1)*sin(t2))/81129638414606681695789005144064 - sin(t1)*sin(t2) - sin(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) + (4967757600021511*cos(t4)*(cos(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) + sin(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1))))/81129638414606681695789005144064 - (4967757600021511*sin(t4)*(sin(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) - cos(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1))))/81129638414606681695789005144064))/405648192073033408478945025720320 + (cos(t5)*(cos(t4)*(sin(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) - cos(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1))) + sin(t4)*(cos(t3)*(sin(t1) - (4967757600021511*cos(t1)*cos(t2))/81129638414606681695789005144064 + (4967757600021511*sin(t1)*sin(t2))/81129638414606681695789005144064) + sin(t3)*(cos(t1)*sin(t2) + cos(t2)*sin(t1)))))/5, 0]
あなたは象徴的な数学を使っていますか?あなたが計算やディスプレイについて話しているかどうかはわかりません。それが最初の場合はhttps://stackoverflow.com/documentation/matlab/1141/performance-and-benchmarking/12687/its-ok-to-be-single#t=201707260959543504814 –
を参照してください。私は記号的な数学を使用していることを言及します これはsymsで動作しませんでした –
シンボリック==遅い。 –