function dx = handleLikeRobot_ode(x,tau) %HADNLELIKEROBOT_ODE state-space model of the handle-like robot % % dx/dt = handleLikeRobot_ode(x,u) % Arguments are the state x = [th0; dth0/dt; th1; dth1/dt; th2; dth2/dt] % and control input u = [tau0; tau2]; k_ts = 10; alph0_ts = 20; dth0dt = x(2,:); dth1dt = x(4,:); dth2dt = x(6,:); tau0 = tau(1,:); tau2 = tau(2,:); th1 = x(3,:); th2 = x(5,:); t2 = cos(th1); t3 = cos(th2); t4 = sin(th1); t5 = sin(th2); t6 = th1+th2; t7 = dth1dt.^2; t8 = dth2dt.^2; t9 = th1.*2.0; t10 = th2.*2.0; t17 = -th2; t32 = dth0dt.*1.128e+5; t33 = dth1dt.*1.128e+5; t37 = tau0.*1.128e+6; t11 = cos(t9); t12 = cos(t10); t13 = sin(t9); t14 = sin(t10); t15 = cos(t6); t16 = sin(t6); t18 = t6+th2; t19 = t6+th1; t24 = t17+th1; t25 = t6.*2.0; t34 = dth0dt.*t2.*2.16e+4; t35 = dth1dt.*t2.*2.16e+4; t36 = dth2dt.*t2.*2.16e+4; t38 = alph0_ts.*k_ts.*t2.*pi.*1.2e+3; t40 = t2.*tau0.*2.16e+5; t41 = t2.*tau2.*2.16e+5; t43 = -t37; t44 = t4.*t7.*2.952e+4; t45 = k_ts.*t2.*th2.*2.16e+5; t20 = cos(t18); t21 = cos(t19); t22 = sin(t18); t23 = sin(t19); t26 = cos(t24); t27 = sin(t24); t28 = t11.*4.4e+1; t29 = cos(t25); t30 = sin(t25); t31 = t12.*1.6e+2; t39 = -t36; t46 = dth2dt.*t15.*1.935e+4; t47 = t13.*3.88476e+5; t48 = -t40; t50 = -t45; t51 = alph0_ts.*k_ts.*t15.*pi.*1.075e+3; t52 = t15.*tau2.*1.935e+5; t54 = dth1dt.*dth2dt.*t16.*2.16e+4; t55 = dth0dt.*t12.*9.6e+4; t56 = dth1dt.*t12.*9.6e+4; t57 = t12.*tau0.*9.6e+5; t63 = t7.*t16.*1.08e+4; t64 = t8.*t16.*1.08e+4; t65 = k_ts.*t15.*th2.*1.935e+5; t42 = t29.*5.0; t53 = -t47; t58 = -t51; t59 = -t52; t60 = dth0dt.*t20.*1.8e+4; t61 = dth1dt.*t20.*1.8e+4; t62 = dth2dt.*t20.*1.8e+4; t66 = -t55; t67 = -t56; t68 = t7.*t22.*1.8e+3; t69 = alph0_ts.*k_ts.*t20.*pi.*1.0e+3; t72 = dth2dt.*t26.*1.98e+4; t73 = t30.*4.4145e+4; t74 = t20.*tau0.*1.8e+5; t75 = t20.*tau2.*1.8e+5; t77 = dth1dt.*dth2dt.*t27.*2.88e+4; t78 = k_ts.*t20.*th2.*1.8e+5; t80 = alph0_ts.*k_ts.*t26.*pi.*1.1e+3; t83 = t26.*tau2.*1.98e+5; t84 = t7.*t27.*1.44e+4; t85 = t8.*t27.*1.44e+4; t86 = k_ts.*t26.*th2.*1.98e+5; t49 = -t42; t70 = -t60; t71 = -t61; t76 = -t68; t79 = -t69; t81 = -t72; t82 = -t75; t87 = -t86; t88 = t28+t31+t49-2.26e+2; t90 = t32+t33+t34+t35+t38+t39+t41+t43+t44+t46+t48+t50+t53+t54+t57+t58+t59+t62+t63+t64+t65+t66+t67+t70+t71+t73+t74+t76+t77+t78+t79+t80+t81+t82+t83+t84+t85+t87; t89 = 1.0./t88; dx = [dth0dt;t89.*t90.*(2.0./1.35e+2);dth1dt;(t89.*(dth0dt.*9.0e+2+dth1dt.*9.0e+2-dth2dt.*9.0e+2-t4.*6.1803e+4+t22.*3.5316e+4-tau0.*9.0e+3+tau2.*9.0e+3+dth0dt.*t2.*2.88e+3+dth1dt.*t2.*2.88e+3-dth2dt.*t3.*8.55e+2-dth0dt.*t20.*2.4e+3-dth1dt.*t20.*2.4e+3+dth2dt.*t21.*4.95e+2-dth0dt.*t29.*4.5e+2-dth1dt.*t29.*4.5e+2+dth2dt.*t29.*4.5e+2-k_ts.*th2.*9.0e+3-t5.*t7.*3.24e+3-t5.*t8.*3.24e+3+t7.*t13.*3.96e+2-t7.*t14.*1.44e+3+t7.*t23.*3.6e+2+t8.*t23.*3.6e+2-t2.*tau0.*2.88e+4+t3.*tau2.*8.55e+3+t20.*tau0.*2.4e+4-t21.*tau2.*4.95e+3+t29.*tau0.*4.5e+3-t29.*tau2.*4.5e+3+alph0_ts.*k_ts.*pi.*5.0e+1-dth1dt.*dth2dt.*t5.*6.48e+3+dth1dt.*dth2dt.*t23.*7.2e+2-k_ts.*t3.*th2.*8.55e+3+k_ts.*t21.*th2.*4.95e+3+k_ts.*t29.*th2.*4.5e+3+alph0_ts.*k_ts.*t3.*pi.*(9.5e+1./2.0)-alph0_ts.*k_ts.*t21.*pi.*(5.5e+1./2.0)-alph0_ts.*k_ts.*t29.*pi.*2.5e+1))./9.0;dth2dt;t89.*(dth0dt.*7.2e+4+dth1dt.*7.2e+4-dth2dt.*1.4589e+5-t4.*4.94424e+6+t16.*2.842938e+6+t22.*2.82528e+6-t27.*3.107808e+6-tau0.*7.2e+5+tau2.*1.4589e+6+dth0dt.*t2.*2.304e+5+dth0dt.*t3.*6.84e+4+dth1dt.*t2.*2.304e+5+dth1dt.*t3.*6.84e+4-dth2dt.*t3.*1.368e+5+dth2dt.*t11.*4.356e+4-dth0dt.*t15.*2.064e+5-dth1dt.*t15.*2.064e+5-dth0dt.*t20.*1.92e+5-dth0dt.*t21.*3.96e+4-dth1dt.*t20.*1.92e+5-dth1dt.*t21.*3.96e+4+dth2dt.*t21.*7.92e+4+dth0dt.*t26.*2.112e+5+dth1dt.*t26.*2.112e+5-dth0dt.*t29.*3.6e+4-dth1dt.*t29.*3.6e+4+dth2dt.*t29.*3.6e+4-k_ts.*th2.*1.4589e+6-t5.*t7.*5.058e+5-t5.*t8.*2.592e+5+t7.*t13.*3.168e+4-t7.*t14.*2.304e+5-t8.*t14.*1.152e+5+t7.*t23.*3.276e+4+t8.*t23.*2.88e+4+t7.*t30.*3.6e+3+t8.*t30.*3.6e+3-t2.*tau0.*2.304e+6-t3.*tau0.*6.84e+5+t3.*tau2.*1.368e+6-t11.*tau2.*4.356e+5+t15.*tau0.*2.064e+6+t20.*tau0.*1.92e+6+t21.*tau0.*3.96e+5-t21.*tau2.*7.92e+5-t26.*tau0.*2.112e+6+t29.*tau0.*3.6e+5-t29.*tau2.*3.6e+5+alph0_ts.*k_ts.*pi.*8.105e+3-dth1dt.*dth2dt.*t5.*5.184e+5-dth1dt.*dth2dt.*t14.*2.304e+5+dth1dt.*dth2dt.*t23.*5.76e+4+dth1dt.*dth2dt.*t30.*7.2e+3-k_ts.*t3.*th2.*1.368e+6+k_ts.*t11.*th2.*4.356e+5+k_ts.*t21.*th2.*7.92e+5+k_ts.*t29.*th2.*3.6e+5+alph0_ts.*k_ts.*t3.*pi.*7.6e+3-alph0_ts.*k_ts.*t11.*pi.*2.42e+3-alph0_ts.*k_ts.*t21.*pi.*4.4e+3-alph0_ts.*k_ts.*t29.*pi.*2.0e+3).*(-1.0./7.2e+2)];