python - TypeError when using scipy.integrate.odeint -


I have to solve a set of coupled differential equations using scipy.integrate.odeint I am trying. However, when I try to run the program, I get the following error:

TypeError: DTP ('O') from DRP ('float64') to 'safe' 'ODACAC . Panic: The result call is not a proper array of floats. Here is the code I use:

  V = "v * * 2/2 * log (1 + x ** 2 + (For fenq, ver): category (y / a) ** 2 + (z / c) ** 2) "var = ['x', 'y', 'z'] def afleiden [I]) for f = sympify (func) partAfg = [ft (init)] return partAfg init = [0.30.2,0.9,0.2,0.6, 0.7] Def Fake (RV, T, Pot, Veer): Return RV [3: 6] + Aflenden (pot, vera) # RV is a list with 6 elements of a dick, which is part of differential equations in the last 3 T = NP .arange (010,0.01) y = Odeint (func, init, t, args = (v, var,))  

may be because a Equation by fleiden is calculated by Simimpi and thus maybe sypmpy expressions? If so, can I do anything about it? I tried to use lambification but it was not working. As the @Wereren Wakeser is called as

and as you suspect, you have to express the expression first Required so that different partial derivatives DV / Door [J] returned a floating point value.

In general, your afleiden function is that it evaluates analytical derivatives of V without computing the value of those expressions. I think that v, a, c are the criteria for your problems, deacribing a possible function V (x, y, z) . I also believe that your ODA <<> X = [x, y, z]

dx / dt = dv / dx (x, y, z) ,

is a list of your variables.

If this is the case, then you have 3 differences in the form of equation, and 6 as your func () (a list of lists of lists of lists Integration, not a list of amounts). Import Scipy.integrate from sympify to CMP import lambdiquity as NPP as import; odeint var = ['x', 'y', 'z'] V = sympify ("v ** 2/2 * log (1 + x ** 2 + (y / a) ** 2 + (z / c) ** 2) "dvdvar_analytical = [v.diff (var [i]) (Var),] dVdvar = [ldvdify ('x', 'y', 'z', 'v', 'a', 'c') for df in dd vdvar_analytical, df def defer (variables, X, y, z = variables v, a, c = parameter returns [dVdvarj (x, y, z, v, a, c) dVdvarj in dVdvar] variables0, params = [0.3, 0.2, 0.9], [0.2, 0.6, 0.7] T = N.P. Ranges (0, 10, 1) y = odenet (efleden, variables 0, T, RGS = (Param, Widder)) Plot (T, Y)

With your expression for potential V , the original is a repeater and Point to y (t) for the simulation leads to infinity Times If you add a zero mark at the beginning of the expression, the original becomes a attractor and the solution 0 :

  # for example zero mark V = sympify ("-V ** 2/2 * log (1 + x ** 2 + (y / a) ** 2 + (z / c) ** 2)") t = np.arange (0, 100, 1)  

Enter image details here


Comments

Popular posts from this blog

c# - Highlight all words containing a letter in a richtextbox -

java - JavaFX WebEngine Video Playback in Linux -

Editing Python Class in Shell and SQLAlchemy -