@@ -1194,77 +1194,6 @@ def cohere(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
11941194 return Cxy , f
11951195
11961196
1197- @cbook .deprecated ('2.2' , 'scipy.integrate.ode' )
1198- def rk4 (derivs , y0 , t ):
1199- """
1200- Integrate 1D or ND system of ODEs using 4-th order Runge-Kutta.
1201- This is a toy implementation which may be useful if you find
1202- yourself stranded on a system w/o scipy. Otherwise use
1203- :func:`scipy.integrate`.
1204-
1205- Parameters
1206- ----------
1207- y0
1208- initial state vector
1209-
1210- t
1211- sample times
1212-
1213- derivs
1214- returns the derivative of the system and has the
1215- signature ``dy = derivs(yi, ti)``
1216-
1217- Examples
1218- --------
1219-
1220- A 2D system::
1221-
1222- def derivs6(x,t):
1223- d1 = x[0] + 2*x[1]
1224- d2 = -3*x[0] + 4*x[1]
1225- return (d1, d2)
1226- dt = 0.0005
1227- t = arange(0.0, 2.0, dt)
1228- y0 = (1,2)
1229- yout = rk4(derivs6, y0, t)
1230-
1231- A 1D system::
1232-
1233- alpha = 2
1234- def derivs(x,t):
1235- return -alpha*x + exp(-t)
1236-
1237- y0 = 1
1238- yout = rk4(derivs, y0, t)
1239-
1240- If you have access to scipy, you should probably be using the
1241- scipy.integrate tools rather than this function.
1242- """
1243-
1244- try :
1245- Ny = len (y0 )
1246- except TypeError :
1247- yout = np .zeros ((len (t ),), float )
1248- else :
1249- yout = np .zeros ((len (t ), Ny ), float )
1250-
1251- yout [0 ] = y0
1252-
1253- for i in np .arange (len (t )- 1 ):
1254-
1255- thist = t [i ]
1256- dt = t [i + 1 ] - thist
1257- dt2 = dt / 2.0
1258- y0 = yout [i ]
1259-
1260- k1 = np .asarray (derivs (y0 , thist ))
1261- k2 = np .asarray (derivs (y0 + dt2 * k1 , thist + dt2 ))
1262- k3 = np .asarray (derivs (y0 + dt2 * k2 , thist + dt2 ))
1263- k4 = np .asarray (derivs (y0 + dt * k3 , thist + dt ))
1264- yout [i + 1 ] = y0 + dt / 6.0 * (k1 + 2 * k2 + 2 * k3 + k4 )
1265- return yout
1266-
1267-
12681197@cbook .deprecated ('2.2' )
12691198def bivariate_normal (X , Y , sigmax = 1.0 , sigmay = 1.0 ,
12701199 mux = 0.0 , muy = 0.0 , sigmaxy = 0.0 ):
0 commit comments