May-09-2022, 06:40 AM
Thanks, I corrected equations. Now, there are 10 arguments:
def fun(x, y): return np.vstack(ptb / y[4] * y[5] / np.sqrt(y[5]**2 + y[6]**2) * function_deo(y[4], y[5], y[6], y[9], ptb, mqb, pes) - 1 / y[2]**2 + y[1]**2 / y[2], ptb / y[4] * y[6] / np.sqrt(y[5]**2 + y[6]**2) * function_deo(y[4], y[5], y[6], y[9], ptb, mqb, pes) - y[0] * y[1] / y[2], y[0], y[1] / y[2], -mqb * function_deo(y[4], y[5], y[6], y[9], ptb, mqb, pes), y[6] * y[1] / y[2] - y[7], -y[5] * 2.0 * y[1] / y[2] + y[6] * y[0] / y[2] - y[8] * 1.0 / y[2], y[5] * (-2.0 / y[2]**3 + y[1]**2 / y[2]**2) + y[6] * (-y[0] * y[1]) / y[2] + y[8] * y[1] / y[2]**2, 0, ptb / y[4]**2 * (np.sqrt(y[5]**2 + y[6]**2)) * function_deo(y[4], y[5], y[6], y[9], ptb, mqb, pes))Here are error message and trace:
TypeError Traceback (most recent call last) <ipython-input-7-5b67a8d7cfc5> in <module>() 19 # y = myFn(R, x, cc) 20 ---> 21 res_a = solve_bvp(fun, bc, x, y_a) 22 res_b = solve_bvp(fun, bc, x, y_b) 23 2 frames <ipython-input-6-6f15cb472e1d> in fun(x, y) 5 -mqb * function_deo(y[4], y[5], y[6], y[9], ptb, mqb, pes), y[6] * y[1] / y[2] - y[7], -y[5] * 2.0 * y[1] / y[2] + y[6] * y[0] / y[2] - y[8] * 1.0 / y[2], 6 y[5] * (-2.0 / y[2]**3 + y[1]**2 / y[2]**2) + y[6] * (-y[0] * y[1]) / y[2] + y[8] * y[1] / y[2]**2, 0, ----> 7 ptb / y[4]**2 * (np.sqrt(y[5]**2 + y[6]**2)) * function_deo(y[4], y[5], y[6], y[9], ptb, mqb, pes)) <__array_function__ internals> in vstack(*args, **kwargs) TypeError: _vhstack_dispatcher() takes 1 positional argument but 10 were givenHow can I change the code to fix the error? Is there something I could use instead of vstack?