<jupyter_start><jupyter_text>Derivatives q<jupyter_code>import casadi as cs

qs =cs.SX.sym("qs",njoints)
qsdot =cs.SX.sym("qsdot",njoints)
qsddot =cs.SX.sym("qsddot",njoints)
taus =cs.SX.sym("taus",njoints)

c_dq = cs.jacobian(c_u2c(qs, qsdot), qs)
g_dq = cs.jacobian(g_u2c(qs), qs)
m_dq = cs.jacobian(m_u2c(qs), qs)
id_dq = cs.jacobian(id_u2c(qs, qsdot, qsddot), qs)
fd_aba_dq = cs.jacobian(fd_aba_u2c(qs, qsdot, taus), qs)
fd_crba_dq = cs.jacobian(fd_crba_u2c(qs, qsdot, taus), qs)


g_dq = cs.Function("g_dq", [qs], [g_dq], {"jit": True, "jit_options":{"flags":"-Ofast"}})
c_dq = cs.Function("C_dq", [qs, qsdot], [c_dq], {"jit": True, "jit_options":{"flags":"-Ofast"}})
m_dq = cs.Function("M_dq", [qs], [m_dq], {"jit": True, "jit_options":{"flags":"-Ofast"}})
id_dq = cs.Function("id_dq", [qs, qsdot, qsddot], [id_dq], {"jit": True, "jit_options":{"flags":"-Ofast"}})
fd_aba_dq = cs.Function("fd_aba_dq", [qs, qsdot, taus], [fd_aba_dq], {"jit": True, "jit_options":{"flags":"-Ofast"}})
fd_crba_dq = cs.Function("fd_crba_dq", [qs, qsdot, taus], [fd_crba_dq], {"jit": True, "jit_options":{"flags":"-Ofast"}})
def fdcrba_dq_func():
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        tau_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
    fd_crba_dq(q_none, qdot_none, tau_none)

def fdaba_dq_func():
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        tau_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
    fd_aba_dq(q_none, qdot_none, tau_none)
    
    
def m_dq_func():   
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2   
    m_dq(q_none)
    
def g_dq_func():   
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
    g_dq(q_none)


def c_dq_func():   
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2

    c_dq(q_none, qdot_none)
    
def id_dq_func():   
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qddot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2

    id_dq(q_none, qdot_none, qddot_none)

def aba_dq_func():   
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        tau_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2

    fd_aba_dq(q_none, qdot_none, tau_none)
    
def crba_dq_func():
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        tau_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
    
    fd_crba_dq(q_none, qdot_none, tau_none)
#timeit_idj = repeat("id_dq_func()", setup = "from __main__ import id_dq_func", repeat = nrepeat, number = nitr)
mediantime_idj = median(timeit_idj)/nitr*1000000

#timeit_gj = repeat("g_dq_func()", setup = "from __main__ import g_dq_func", repeat = nrepeat, number = nitr)
mediantime_gj = median(timeit_gj)/nitr*1000000

#timeit_cj = repeat("c_dq_func()", setup = "from __main__ import c_dq_func", repeat = nrepeat, number = nitr)
mediantime_cj = median(timeit_cj)/nitr*1000000

#timeit_mj = repeat("m_dq_func()", setup = "from __main__ import m_dq_func", repeat = nrepeat, number = nitr)
mediantime_mj = median(timeit_mj)/nitr*1000000

timeit_fdabaj = repeat("aba_dq_func()", setup = "from __main__ import aba_dq_func", repeat = nrepeat, number = nitr)
mediantime_fd_abaj = median(timeit_fdabaj)/nitr*1000000

timeit_fdcrbaj = repeat("crba_dq_func()", setup = "from __main__ import crba_dq_func", repeat = nrepeat, number = nitr)
mediantime_fd_crbaj = median(timeit_fdcrbaj)/nitr*1000000

   
print "\nur5_id_d=", mediantime_idj
print "\nur5_g_d=", mediantime_gj
print "\nur5_c_d=", mediantime_cj
print "\nur5_m_d=", mediantime_mj
print "\nur5_fdaba_d=", mediantime_fd_abaj
print "\nur5_fdcrba_d=", mediantime_fd_crbaj<jupyter_output>ur5_id_d= 37.9405021667

ur5_g_d= 15.5701637268

ur5_c_d= 27.195930481

ur5_m_d= 17.228603363

ur5_fdaba_d= 50.4510402679

ur5_fdcrba_d= 46.3529825211<jupyter_text>ur5_id_d= 38.9980077744ur5_g_d= 15.8679485321ur5_C_d= 27.7240276337ur5_M_d= 17.8405046463ur5_fdaba_d= 46.168088913ur5_fdcrba_d= 46.4965105057ur5_fdaba_d= 50.4510402679ur5_fdcrba_d= 46.3529825211ur5_id_d= 36.6973876953ur5_g_d= 16.0750150681ur5_C_d= 28.6685228348ur5_M_d= 17.9800987244ur5_fdaba_d= 37.5105142593ur5_fdcrba_d= 37.5329256058ur5_id_d= 37.966966629ur5_g_d= 15.5701637268ur5_c_d= 27.4249315262ur5_m_d= 17.228603363ur5_fdaba_d= 49.1979122162ur5_fdcrba_d= 49.2479801178ur5_fdaba_d= 49.1869449615ur5_fdcrba_d= 45.9444522858ur5_fdaba_d= 48.945069313ur5_fdcrba_d= 46.1720228195 qdot<jupyter_code>c_dqdot = cs.jacobian(c_u2c(qs, qsdot), qs)
id_dqdot = cs.jacobian(id_u2c(qs, qsdot, qsddot), qsdot)
fd_aba_dqdot = cs.jacobian(fd_aba_u2c(qs, qsdot, taus), qsdot)
fd_crba_dqdot = cs.jacobian(fd_crba_u2c(qs, qsdot, taus), qsdot)

c_dqdot = cs.Function("c_dq", [qs, qsdot], [c_dqdot], {"jit": True, "jit_options":{"flags":"-Ofast"}})
id_dqdot = cs.Function("id_dq", [qs, qsdot, qsddot], [id_dqdot], {"jit": True, "jit_options":{"flags":"-Ofast"}})
fd_aba_dqdot = cs.Function("fd_aba_dq", [qs, qsdot, taus], [fd_aba_dqdot], {"jit": True, "jit_options":{"flags":"-Ofast"}})
fd_crba_dqdot = cs.Function("fd_crba_dq", [qs, qsdot, taus], [fd_crba_dqdot], {"jit": True, "jit_options":{"flags":"-Ofast"}})


def c_dqdot_func():   
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2

    c_dqdot(q_none, qdot_none)
    
def id_dqdot_func():   
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qddot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2

    id_dqdot(q_none, qdot_none, qddot_none)

def aba_dqdot_func():   
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        tau_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2

    fd_aba_dqdot(q_none, qdot_none, tau_none)
    
def crba_dqdot_func():
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        tau_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
    
    fd_crba_dqdot(q_none, qdot_none, tau_none)
#timeit_idj = repeat("id_dqdot_func()", setup = "from __main__ import id_dqdot_func", repeat = nrepeat, number = nitr)
mediantime_idj = median(timeit_idj)/nitr*1000000

#timeit_cj = repeat("c_dqdot_func()", setup = "from __main__ import c_dqdot_func", repeat = nrepeat, number = nitr)
mediantime_cj = median(timeit_cj)/nitr*1000000


timeit_fdabaj = repeat("aba_dqdot_func()", setup = "from __main__ import aba_dqdot_func", repeat = nrepeat, number = nitr)
mediantime_fd_abaj = median(timeit_fdabaj)/nitr*1000000

timeit_fdcrbaj = repeat("crba_dqdot_func()", setup = "from __main__ import crba_dqdot_func", repeat = nrepeat, number = nitr)
mediantime_fd_crbaj = median(timeit_fdcrbaj)/nitr*1000000

   
print "\nur5_id_d=", mediantime_idj
print "\nur5_C_d=", mediantime_cj
print "\nur5_fdaba_d=", mediantime_fd_abaj
print "\nur5_fdcrba_d=", mediantime_fd_crbaj<jupyter_output>ur5_id_d= 37.9405021667

ur5_C_d= 27.195930481

ur5_fdaba_d= 38.8225317001

ur5_fdcrba_d= 38.6475324631<jupyter_text>ur5_fdaba_d= 38.7120246887ur5_fdcrba_d= 38.6099815369ur5_fdaba_d= 39.2190217972ur5_fdcrba_d= 38.8514995575ur5_id_d= 37.7110242844ur5_C_d= 27.3430347443ur5_fdaba_d= 41.2844419479ur5_fdcrba_d= 38.8004779816 qddot / tau<jupyter_code>id_dqddot = cs.jacobian(id_u2c(qs, qsdot, qsddot), qsddot)
fd_aba_dtau = cs.jacobian(fd_aba_u2c(qs, qsdot, taus), taus)
fd_crba_dtau = cs.jacobian(fd_crba_u2c(qs, qsdot, taus), taus)

id_dqddot = cs.Function("id_qddot", [qs, qsdot, qsddot], [id_dqddot], {"jit": True, "jit_options":{"flags":"-Ofast"}})
fd_aba_dtau = cs.Function("fd_aba_dtau", [qs, qsdot, taus], [fd_aba_dtau], {"jit": True, "jit_options":{"flags":"-Ofast"}})
fd_crba_dtau = cs.Function("fd_crba_dtau", [qs, qsdot, taus], [fd_crba_dtau], {"jit": True, "jit_options":{"flags":"-Ofast"}})
def id_dqddot_func():   
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qddot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2

    id_dqddot(q_none, qdot_none, qddot_none)

def aba_dtau_func():   
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        tau_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2

    fd_aba_dtau(q_none, qdot_none, tau_none)
    
def crba_dtau_func():
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        tau_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
    
    fd_crba_dtau(q_none, qdot_none, tau_none)
timeit_idj = repeat("id_dqddot_func()", setup = "from __main__ import id_dqddot_func", repeat = nrepeat, number = nitr)
mediantime_idj = median(timeit_idj)/nitr*1000000

timeit_fdabaj = repeat("aba_dtau_func()", setup = "from __main__ import aba_dtau_func", repeat = nrepeat, number = nitr)
mediantime_fd_abaj = median(timeit_fdabaj)/nitr*1000000

timeit_fdcrbaj = repeat("crba_dtau_func()", setup = "from __main__ import crba_dtau_func", repeat = nrepeat, number = nitr)
mediantime_fd_crbaj = median(timeit_fdcrbaj)/nitr*1000000

   
print "\nur5_id_d=", mediantime_idj
print "\nur5_fdaba_d=", mediantime_fd_abaj
print "\nur5_fdcrba_d=", mediantime_fd_crbaj

ur5_id_d= 36.5724563599

ur5_fdaba_d= 37.5800132751

ur5_fdcrba_d= 36.8819236755




ur5_id_d= 36.7964506149

ur5_fdaba_d= 39.6649837494

ur5_fdcrba_d= 36.8354320526<jupyter_output><empty_output><jupyter_text>derivatives all<jupyter_code>import casadi as cs
qs =cs.SX.sym("qs",njoints)
qsdot =cs.SX.sym("qsdot",njoints)
qsddot =cs.SX.sym("qsddot",njoints)
qsdddot = cs.SX.sym("qsdddot", njoints)
taus =cs.SX.sym("taus",njoints)
tausdot =cs.SX.sym("tausdot",njoints)

c_vec = cs.vertcat(qs, qsdot)
c_dvec = cs.vertcat(qsdot, qsddot)
id_vec = cs.vertcat(qs, qsdot, qsddot)
id_dvec = cs.vertcat(qsdot, qsdot, qsdddot)
fd_vec = cs.vertcat(qs, qsdot, qsddot)
fd_dvec = cs.vertcat(qsdot, qsdot, tausdot)

dc = cs.jacobian(c_u2c(qs, qsdot), c_vec)
dc = cs.Function("dc", [qs, qsdot], [dc], {"jit": True, "jit_options":{"flags":"-Ofast"}})

dctimes = cs.jtimes(c_u2c(qs, qsdot), c_vec, c_dvec)
dctimes = cs.Function("dctimes", [qs, qsdot, qsddot], [dctimes], {"jit": True, "jit_options":{"flags":"-Ofast"}})

did = cs.jacobian(id_u2c(qs, qsdot, qsddot), id_vec)
did = cs.Function("did", [qs, qsdot, qsddot], [did], {"jit": True, "jit_options":{"flags":"-Ofast"}})

didtimes = cs.jtimes(id_u2c(qs, qsdot, qsddot), id_vec, id_dvec)
didtimes = cs.Function("didtimes", [qs, qsdot, qsddot, qsdddot], [didtimes], {"jit": True, "jit_options":{"flags":"-Ofast"}})


dfd_aba = cs.jacobian(fd_aba_u2c(qs, qsdot, taus), fd_vec)
dfd_aba = cs.Function("dfd_aba", [qs, qsdot, taus], [dfd_aba], {"jit": True, "jit_options":{"flags":"-Ofast"}})

dfdtimes_aba = cs.jtimes(fd_aba_u2c(qs, qsdot, taus), fd_vec, fd_dvec)
dfdtimes_aba = cs.Function("dfdtimes_aba", [qs, qsdot, taus, qsddot, tausdot], [dfdtimes_aba], {"jit": True, "jit_options":{"flags":"-Ofast"}})

dfd_crba = cs.jacobian(fd_crba_u2c(qs, qsdot, taus), fd_vec)
dfd_crba = cs.Function("dfd_crba", [qs, qsdot, taus], [dfd_crba], {"jit": True, "jit_options":{"flags":"-Ofast"}})

dfdtimes_crba = cs.jtimes(fd_crba_u2c(qs, qsdot, taus), fd_vec, fd_dvec)
dfdtimes_crba = cs.Function("dfdtimes_crba", [qs, qsdot, taus, qsddot, tausdot], [dfdtimes_crba], {"jit": True, "jit_options":{"flags":"-Ofast"}})

dg = cs.jacobian(g_u2c(qs), qs)
dg = cs.Function("dg", [qs], [dg], {"jit": True, "jit_options":{"flags":"-Ofast"}})


dm = cs.jacobian(m_u2c(qs), qs)
dm = cs.Function("dm", [qs], [dm], {"jit": True, "jit_options":{"flags":"-Ofast"}})

dgtimes = cs.jtimes(g_u2c(qs), qs, qsdot)
dgtimes = cs.Function("dgtimes", [qs, qsdot], [dgtimes], {"jit": True, "jit_options":{"flags":"-Ofast"}})

dmtimes = cs.jtimes(m_u2c(qs), qs, qsdot)
dmtimes = cs.Function("dmtimes", [qs, qsdot], [dmtimes], {"jit": True, "jit_options":{"flags":"-Ofast"}})


print "\nur5_nodes_did = ", did.n_nodes()
print "\nur5_nodes_dc = ", dc.n_nodes()
print "\nur5_nodes_dm = ", dm.n_nodes()
print "\nur5_nodes_dg = ", dg.n_nodes()
print "\nur5_nodes_dfd_aba = ", dfd_aba.n_nodes()
print "\nur5_nodes_dfd_crba =", dfd_crba.n_nodes()

print "\nur5_nodes_didtimes = ", didtimes.n_nodes()
print "\nur5_nodes_dctimes = ", dctimes.n_nodes()
print "\nur5_nodes_dmtimes = ", dmtimes.n_nodes()
print "\nur5_nodes_dgtimes = ", dgtimes.n_nodes()
print "\nur5_nodes_dfdtimes_aba = ", dfdtimes_aba.n_nodes()
print "\nur5_nodes_dfdtimes_crba =", dfdtimes_crba.n_nodes()


def dfd_crba_func():
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        tau_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
    dfd_crba(q_none, qdot_none, tau_none)
   
def dfdtimes_crba_func():
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        tau_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qddot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        taudot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
    dfdtimes_crba(q_none, qdot_none, tau_none, qddot_none, taudot_none)

def dfd_aba_func():
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        tau_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
    dfd_aba(q_none, qdot_none, tau_none)
   
def dfdtimes_aba_func():
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qddot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        taudot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
    dfdtimes_aba(q_none, qdot_none, tau_none, qddot_none, taudot_none)
   
   
   
def dm_func():  
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2  
    dm(q_none)
   
def dg_func():  
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
    dg(q_none)
   
   
def dmtimes_func():  
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2  
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
    dmtimes(q_none, qdot_none)
   
def dgtimes_func():  
    for j in range(njoints):
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2        
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
    dgtimes(q_none, qdot_none)


def dc_func():  
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2

    dc(q_none, qdot_none)
   
   
def dctimes_func():  
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qddot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2

    dctimes(q_none, qdot_none, qddot_none)
   
   
def did_func():
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qddot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
    did(q_none, qdot_none, qddot_none)
   
def didtimes_func():
    for j in range(njoints):
        q_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qddot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
        qdddot_none[j] = (qmax[j] - qmin[j])*np.random.rand()-(qmax[j] - qmin[j])/2
    didtimes(q_none, qdot_none, qddot_none, qdddot_none)

qdddot_none = [None]*njoints
taudot_none = [None]*njoints




ur5_nodes_did =  4731

ur5_nodes_dc =  5157

ur5_nodes_dm =  4095

ur5_nodes_dg =  881

ur5_nodes_dfd_aba =  13517

ur5_nodes_dfd_crba = 17764


ur5_nodes_didtimes =  1807

ur5_nodes_dctimes =  1707

ur5_nodes_dmtimes =  2909

ur5_nodes_dgtimes =  491

ur5_nodes_dfdtimes_aba =  5828

ur5_nodes_dfdtimes_crba = 6906
timeit_did = repeat("did_func()", setup = "from __main__ import did_func", repeat = nrepeat, number = nitr)
mediantime_did = median(timeit_did)/nitr*1000000

timeit_dg = repeat("dg_func()", setup = "from __main__ import dg_func", repeat = nrepeat, number = nitr)
mediantime_dg = median(timeit_dg)/nitr*1000000

timeit_dc = repeat("dc_func()", setup = "from __main__ import dc_func", repeat = nrepeat, number = nitr)
mediantime_dc = median(timeit_dc)/nitr*1000000

timeit_dm = repeat("dm_func()", setup = "from __main__ import dm_func", repeat = nrepeat, number = nitr)
mediantime_dm = median(timeit_dm)/nitr*1000000

timeit_dfd_aba = repeat("dfd_aba_func()", setup = "from __main__ import dfd_aba_func", repeat = nrepeat, number = nitr)
mediantime_dfd_aba = median(timeit_dfd_aba)/nitr*1000000

timeit_dfd_crba = repeat("dfd_crba_func()", setup = "from __main__ import dfd_crba_func", repeat = nrepeat, number = nitr)
mediantime_dfd_crba = median(timeit_dfd_crba)/nitr*1000000

   
print "\nur5_did =", mediantime_did
print "\nur5_dg =", mediantime_dg
print "\nur5_dc =", mediantime_dc
print "\nur5_dm =", mediantime_dm
print "\nur5_dfd_aba =", mediantime_dfd_aba
print "\nur5_dfd_crba =", mediantime_dfd_crba<jupyter_output>ur5_did = 40.4714345932

ur5_dg = 15.4880285263

ur5_dc = 29.744386673

ur5_dm = 18.0056095123

ur5_dfd_aba = 52.5209903717

ur5_dfd_crba = 50.784945488<jupyter_text>ur5_nodes_did =  4731ur5_nodes_dc =  5157ur5_nodes_dm =  4095ur5_nodes_dg =  881ur5_nodes_dfd_aba =  13517ur5_nodes_dfd_crba = 17764ur5_nodes_didtimes =  1807ur5_nodes_dctimes =  1707ur5_nodes_dmtimes =  2909ur5_nodes_dgtimes =  491ur5_nodes_dfdtimes_aba =  5828ur5_nodes_dfdtimes_crba = 6906ur5_did = 40.0873422623ur5_dg = 15.3809785843ur5_dc = 29.6190977097ur5_dm = 17.1409845352ur5_dfd_aba = 50.2574443817ur5_dfd_crba = 48.3536720276<jupyter_code>timeit_didtimes = repeat("didtimes_func()", setup = "from __main__ import didtimes_func", repeat = nrepeat, number = nitr)
mediantime_didtimes = median(timeit_didtimes)/nitr*1000000

timeit_dgtimes = repeat("dgtimes_func()", setup = "from __main__ import dgtimes_func", repeat = nrepeat, number = nitr)
mediantime_dgtimes = median(timeit_dgtimes)/nitr*1000000

timeit_dctimes = repeat("dctimes_func()", setup = "from __main__ import dctimes_func", repeat = nrepeat, number = nitr)
mediantime_dctimes = median(timeit_dctimes)/nitr*1000000

timeit_dmtimes = repeat("dmtimes_func()", setup = "from __main__ import dmtimes_func", repeat = nrepeat, number = nitr)
mediantime_dmtimes = median(timeit_dmtimes)/nitr*1000000

timeit_dfdtimes_aba = repeat("dfdtimes_aba_func()", setup = "from __main__ import dfdtimes_aba_func", repeat = nrepeat, number = nitr)
mediantime_dfdtimes_aba = median(timeit_dfdtimes_aba)/nitr*1000000

timeit_dfdtimes_crba = repeat("dfdtimes_crba_func()", setup = "from __main__ import dfdtimes_crba_func", repeat = nrepeat, number = nitr)
mediantime_dfdtimes_crba = median(timeit_dfdtimes_crba)/nitr*1000000

print "\nur5_didtimes =", mediantime_didtimes
print "\nur5_dgtimes =", mediantime_dgtimes
print "\nur5_dctimes =", mediantime_dctimes
print "\nur5_dmtimes =", mediantime_dmtimes
print "\nur5_dfdtimes_aba =", mediantime_dfdtimes_aba
print "\nur5_dfdtimes_crba =", mediantime_dfdtimes_crba<jupyter_output>ur5_didtimes = 49.7659444809

ur5_dgtimes = 26.8129110336

ur5_dctimes = 37.9886627197

ur5_dmtimes = 30.0456285477

ur5_dfdtimes_aba = 55.1775693893

ur5_dfdtimes_crba = 69.8469877243<jupyter_text>ur5_didtimes = 49.3636131287ur5_dgtimes = 25.5494117737ur5_dctimes = 37.2189283371ur5_dmtimes = 28.6979675293ur5_dfdtimes_aba = 54.1299581528ur5_dfdtimes_crba = 66.9349431992ur5_didtimes = 49.0859746933ur5_dgtimes = 25.4321098328ur5_dctimes = 36.9275808334ur5_dmtimes = 28.3726453781ur5_dfdtimes_aba = 53.7585020065ur5_dfdtimes_crba = 67.2144889832  Number of Operations<jupyter_code>print "\nur5_nodes_id=", id_u2c.n_nodes()
print "\nur5_nodes_c=", c_u2c.n_nodes()
print "\nur5_nodes_m=", m_u2c.n_nodes()
print "\nur5_nodes_g=", g_u2c.n_nodes()
print "\nur5_nodes_fdaba", fd_aba_u2c.n_nodes()
print "\nur5_nodes_fdcrba=", fd_crba_u2c.n_nodes() 

print "\n\nur5_nodes_id_dq=", id_dq.n_nodes()
print "\nur5_nodes_c_dq=", c_dq.n_nodes()
print "\nur5_nodes_m_dq =", m_dq.n_nodes()
print "\nur5_nodes_g_dq =", g_dq.n_nodes()
print "\nur5_nodes_fdaba_dq =", fd_aba_dq.n_nodes()
print "\nur5_nodes_fdcrba_dq =", fd_crba_dq.n_nodes()     

print "\n\nur5_nodes_id_dqdot=", id_dqdot.n_nodes()
print "\nur5_nodes_c_dqdot =", c_dqdot.n_nodes()
print "\nur5_nodes_fdaba_dqdot =", fd_aba_dqdot.n_nodes()
print "\nur5_nodes_fdcrba_dqdot =", fd_crba_dqdot.n_nodes()     

print "\n\nur5_nodes_id_dqddot=", id_dqddot.n_nodes()
print "\nur5_nodes_fdaba_dtau =", fd_aba_dtau.n_nodes()
print "\nur5_nodes_fdcrba_dtau =", fd_crba_dtau.n_nodes()<jupyter_output>ur5_nodes_id= 696

ur5_nodes_c= 648

ur5_nodes_m= 1026

ur5_nodes_g= 199

ur5_nodes_fdaba 1948

ur5_nodes_fdcrba= 2354


ur5_nodes_id_dq= 3069

ur5_nodes_c_dq= 3006

ur5_nodes_m_dq = 4095

ur5_nodes_g_dq = 881

ur5_nodes_fdaba_dq = 10189

ur5_nodes_fdcrba_dq = 15194


ur5_nodes_id_dqdot= 2371

ur5_nodes_c_dqdot = 3006

ur5_nodes_fdaba_dqdot = 4605

ur5_nodes_fdcrba_dqdot = 4413


ur5_nodes_id_dqddot= 809

ur5_nodes_fdaba_dtau = 2186

ur5_nodes_fdcrba_dtau = 1695
{'fraction_non_alphanumeric': 0.17955271565495207, 'fraction_numerical': 0.06602768903088392, 'mean_word_length': 4.953842252092316, 'pattern_counts': {'":': 75, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '362788', 'license': 'MIT', 'n_tokens_mistral': 12319, 'n_tokens_neox': 11133, 'n_words': 1577, 'path': 'examples/timing/robot_comparison/ur5_data.ipynb', 'repo_name': 'maxspahn/urdf2casadi', 'size': '23475'}