differential-equations

How to monitor the process of SciPy.odeint?

拜拜、爱过 提交于 2021-02-08 07:21:27
问题 SciPy can solve ode equations by scipy.integrate.odeint or other packages, but it gives result after the function has been solved completely. However, if the ode function is very complex, the program will take a lot of time(one or two days) to give the whole result. So how can I mointor the step it solve the equations(print out result when the equation hasn't been solved completely)? 回答1: You could split the integration domain and integrate the segments, taking the last value of the previous

How to monitor the process of SciPy.odeint?

有些话、适合烂在心里 提交于 2021-02-08 07:20:27
问题 SciPy can solve ode equations by scipy.integrate.odeint or other packages, but it gives result after the function has been solved completely. However, if the ode function is very complex, the program will take a lot of time(one or two days) to give the whole result. So how can I mointor the step it solve the equations(print out result when the equation hasn't been solved completely)? 回答1: You could split the integration domain and integrate the segments, taking the last value of the previous

Minimal surface solution in Python

懵懂的女人 提交于 2021-02-06 06:55:07
问题 I have a set of 3D points defining a 3D contour. What I want to do is to obtain the minimal surface representation corresponding to this contour (see Minimal Surfaces in Wikipedia). Basically this requires to solve a nonlinear partial differential equation. In Matlab this is almost straightforward using the pdenonlin function (see Matlab's documentation). An example of its usage for solving a minimal surface problem can be found here: Minimal Surface Problem on the Unit Disk. I need to make

Minimal surface solution in Python

梦想的初衷 提交于 2021-02-06 06:55:05
问题 I have a set of 3D points defining a 3D contour. What I want to do is to obtain the minimal surface representation corresponding to this contour (see Minimal Surfaces in Wikipedia). Basically this requires to solve a nonlinear partial differential equation. In Matlab this is almost straightforward using the pdenonlin function (see Matlab's documentation). An example of its usage for solving a minimal surface problem can be found here: Minimal Surface Problem on the Unit Disk. I need to make

Does the order of the equations in a coupled OIDENT solver matter?

我与影子孤独终老i 提交于 2021-02-05 10:39:32
问题 My code runs, however, if i change the order of the equations defined in my formula my graphs changes as well. Can somebody tell me why this is? Now i do not know what the right graph is from this system. def myFunction(r,t): g = 9.81 L_L = 20 #draught L_r = 20 #draught L_d = 4 #ukc u_s = 0.08 w_d = 60 #width vessel rho = 1030 b_R = 1.0 b_L = 1.0 b_D = 1.0 A_s = 340*L_L M_s = 40000*10^3 w_L = r[0] w_r = r[1] u_1 = r[2] u_2 = r[3] u_3 = r[4] u_4 = r[5] u_d = r[6] p_1 = r[7] p_2 = r[8] p_3 = r

Does the order of the equations in a coupled OIDENT solver matter?

試著忘記壹切 提交于 2021-02-05 10:39:22
问题 My code runs, however, if i change the order of the equations defined in my formula my graphs changes as well. Can somebody tell me why this is? Now i do not know what the right graph is from this system. def myFunction(r,t): g = 9.81 L_L = 20 #draught L_r = 20 #draught L_d = 4 #ukc u_s = 0.08 w_d = 60 #width vessel rho = 1030 b_R = 1.0 b_L = 1.0 b_D = 1.0 A_s = 340*L_L M_s = 40000*10^3 w_L = r[0] w_r = r[1] u_1 = r[2] u_2 = r[3] u_3 = r[4] u_4 = r[5] u_d = r[6] p_1 = r[7] p_2 = r[8] p_3 = r

Does the order of the equations in a coupled OIDENT solver matter?

为君一笑 提交于 2021-02-05 10:39:18
问题 My code runs, however, if i change the order of the equations defined in my formula my graphs changes as well. Can somebody tell me why this is? Now i do not know what the right graph is from this system. def myFunction(r,t): g = 9.81 L_L = 20 #draught L_r = 20 #draught L_d = 4 #ukc u_s = 0.08 w_d = 60 #width vessel rho = 1030 b_R = 1.0 b_L = 1.0 b_D = 1.0 A_s = 340*L_L M_s = 40000*10^3 w_L = r[0] w_r = r[1] u_1 = r[2] u_2 = r[3] u_3 = r[4] u_4 = r[5] u_d = r[6] p_1 = r[7] p_2 = r[8] p_3 = r

Individual age at peak velocity from linear mixed natural spline model

耗尽温柔 提交于 2021-01-29 12:49:00
问题 This thread continues with Get subject-specific peak velocity and age at peak velocity values from linear mixed spline models. I am fitting a linear mixed effects model with a natural spline function for age. I would like to estimate age at peak velocity (apv - years) and peak velocity (pv - grams) for each person in the dataset by differentiating the spline terms. The model includes a random quadratic slope for age. How can I estimate the person-specific apv and pv? I am using the

Solving set of Boundary Value Problems

点点圈 提交于 2021-01-28 11:26:25
问题 I am trying to solve a set of boundary value problems given by 4 differential equations. I am using bvp_solver in python, and I am getting errors which state 'invalid value encountered in division'. I am assuming this means I am dividing by NaN or 0 at some point, but I am unsure where. import numpy as np from scipy.integrate import solve_bvp import matplotlib.pyplot as plt %matplotlib inline alpha = 1 zeta = 1 C_k = 1 sigma = 1 Q = 30 U_0 = 0.1 gamma = 5/3 theta = 3 m = 1.5 def fun(x, y): U,

Lorenz attractor with Runge-Kutta python

吃可爱长大的小学妹 提交于 2020-12-15 13:28:34
问题 Hello I have to program a python function to solve Lorenz differential equations using Runge-Kutta 2cond grade sigma=10, r=28 and b=8/3 with initial conditions (x,y,z)=(0,1,0) this is the code i wrote, but it throws me an error saying overflow encountered in double_scalars , and I don't see what is wrong with the program from pylab import * def runge_4(r0,a,b,n,f1,f2,f3): def f(r,t): x=r[0] y=r[1] z=r[2] fx=f1(x,y,z,t) fy=f2(x,y,z,t) fz=f3(x,y,z,t) return array([fx,fy,fz],float) h=(b-a)/n