@@ -47,7 +47,8 @@ function f_1delay(::Type{Val{:analytic}}, u₀, p, t)
4747end
4848
4949build_prob_dde_1delay (u₀, :: T = u₀) where {T} =
50- DDEProblem (f_1delay, t-> [zero (u₀)], [u₀], (zero (T), T (10 )), nothing , [oneunit (T)])
50+ DDEProblem (f_1delay, [u₀], t-> [zero (u₀)], (zero (T), T (10 )),
51+ constant_lags = [oneunit (T)])
5152
5253"""
5354 prob_dde_1delay
@@ -86,7 +87,8 @@ f_1delay_notinplace(::Type{Val{:analytic}}, u0, p, t) = f_1delay(Val{:analytic},
8687# ### Vectorized history function
8788
8889build_prob_dde_1delay_notinplace (u₀, :: T = u₀) where {T} =
89- DDEProblem (f_1delay_notinplace, t-> [zero (u₀)], [u₀], (zero (T), T (10 )), nothing , [oneunit (T)])
90+ DDEProblem (f_1delay_notinplace, [u₀], t-> [zero (u₀)], (zero (T), T (10 )),
91+ constant_lags = [oneunit (T)])
9092
9193"""
9294 prob_dde_1delay_notinplace
@@ -99,7 +101,8 @@ prob_dde_1delay_notinplace = build_prob_dde_1delay_notinplace(1.0)
99101# ### Scalar history function
100102
101103build_prob_dde_1delay_scalar_notinplace (u₀, :: T = u₀) where {T} =
102- DDEProblem (f_1delay_notinplace, t -> zero (u₀), u₀, (zero (T), T (10 )), nothing , [oneunit (T)])
104+ DDEProblem (f_1delay_notinplace, u₀, t -> zero (u₀), (zero (T), T (10 )),
105+ constant_lags = [oneunit (T)])
103106
104107"""
105108 prob_dde_1delay_scalar_notinplace
@@ -154,7 +157,8 @@ function f_2delays(::Type{Val{:analytic}}, u₀, p, t)
154157end
155158
156159build_prob_dde_2delays (u₀, :: T = u₀) where {T} =
157- DDEProblem (f_2delays, t -> [zero (u₀)], [u₀], (zero (T), oneunit (T)), nothing , [T (1 // 3 ), T (1 // 5 )])
160+ DDEProblem (f_2delays, [u₀], t -> [zero (u₀)], (zero (T), oneunit (T)),
161+ constant_lags = [T (1 // 3 ), T (1 // 5 )])
158162
159163"""
160164 prob_dde_2delays
@@ -194,8 +198,8 @@ f_2delays_notinplace(::Type{Val{:analytic}}, u0, p, t) =
194198# ### Vectorized history function
195199
196200build_prob_dde_2delays_notinplace (u₀, :: T = u₀) where {T} =
197- DDEProblem (f_2delays_notinplace, t -> [zero (u₀)], [u₀ ], (zero (T), oneunit (T)),
198- nothing , [T (1 // 3 ), T (1 // 5 )])
201+ DDEProblem (f_2delays_notinplace, [u₀], t -> [zero (u₀)], (zero (T), oneunit (T)),
202+ constant_lags = [T (1 // 3 ), T (1 // 5 )])
199203
200204"""
201205 prob_dde_2delays_notinplace
@@ -208,8 +212,8 @@ prob_dde_2delays_notinplace = build_prob_dde_2delays_notinplace(1.0)
208212# ### Scalar history function
209213
210214build_prob_dde_2delays_scalar_notinplace (u₀, :: T = u₀) where {T} =
211- DDEProblem (f_2delays_notinplace, t -> zero (u₀), u₀ , (zero (T), oneunit (T)),
212- nothing , [T (1 // 3 ), T (1 // 5 )])
215+ DDEProblem (f_2delays_notinplace, u₀, t -> zero (u₀), (zero (T), oneunit (T)),
216+ constant_lags = [T (1 // 3 ), T (1 // 5 )])
213217
214218"""
215219 prob_dde_2delays_scalar_notinplace
@@ -230,7 +234,8 @@ function f_1delay_long(du, u, h, p, t::T) where T
230234end
231235
232236build_prob_dde_1delay_long (u₀, :: T = u₀) where {T} =
233- DDEProblem (f_1delay_long, t -> [zero (u₀)], [u₀], (zero (T), T (100 )), nothing , [T (1 // 5 )])
237+ DDEProblem (f_1delay_long, [u₀], t -> [zero (u₀)], (zero (T), T (100 )),
238+ constant_lags = [T (1 // 5 )])
234239
235240"""
236241 prob_dde_1delay_long
@@ -263,8 +268,8 @@ function f_1delay_long_notinplace(u, h, p, t::T) where T
263268end
264269
265270build_prob_dde_1delay_long_notinplace (u₀, :: T = u₀) where {T} =
266- DDEProblem (f_1delay_long_notinplace, t -> [zero (u₀)], [u₀ ], (zero (T), T (100 )),
267- nothing , [T (1 // 5 )])
271+ DDEProblem (f_1delay_long_notinplace, [u₀], t -> [zero (u₀)], (zero (T), T (100 )),
272+ constant_lags = [T (1 // 5 )])
268273
269274"""
270275 prob_dde_1delay_long_notinplace
@@ -275,7 +280,8 @@ in-place function.
275280prob_dde_1delay_long_notinplace = build_prob_dde_1delay_long_notinplace (1.0 )
276281
277282build_prob_dde_1delay_long_scalar_notinplace (u₀, :: T = u₀) where {T} =
278- DDEProblem (f_1delay_long_notinplace, t -> zero (u₀), u₀, (zero (T), T (100 )), nothing , [T (1 // 5 )])
283+ DDEProblem (f_1delay_long_notinplace, u₀, t -> zero (u₀), (zero (T), T (100 )),
284+ constant_lags = [T (1 // 5 )])
279285
280286"""
281287 prob_dde_1delay_long_scalar_notinplace
@@ -294,7 +300,8 @@ function f_2delays_long(du, u, h, p, t::T) where T
294300end
295301
296302build_prob_dde_2delays_long (u₀, :: T = u₀) where {T} =
297- DDEProblem (f_2delays_long, t -> [zero (u₀)], [u₀], (zero (T), T (100 )), nothing , [T (1 // 3 ), T (1 // 5 )])
303+ DDEProblem (f_2delays_long, [u₀], t -> [zero (u₀)], (zero (T), T (100 )),
304+ constant_lags = [T (1 // 3 ), T (1 // 5 )])
298305
299306"""
300307 prob_dde_2delays_long
329336# ### Vectorized history function
330337
331338build_prob_dde_2delays_long_notinplace (u₀, :: T = u₀) where {T} =
332- DDEProblem (f_2delays_long_notinplace, t -> [zero (u₀)], [u₀ ], (zero (T), T (100 )),
333- nothing , [T (1 // 3 ), T (1 // 5 )])
339+ DDEProblem (f_2delays_long_notinplace, [u₀], t -> [zero (u₀)], (zero (T), T (100 )),
340+ constant_lags = [T (1 // 3 ), T (1 // 5 )])
334341
335342"""
336343 prob_dde_2delays_long_notinplace
@@ -343,8 +350,8 @@ prob_dde_2delays_long_notinplace = build_prob_dde_2delays_long_notinplace(1.0)
343350# ### Scalar history function
344351
345352build_prob_dde_2delays_long_scalar_notinplace (u₀, :: T = u₀) where {T} =
346- DDEProblem (f_2delays_long_notinplace, t -> zero (u₀), u₀ , (zero (T), T (100 )),
347- nothing , [T (1 // 3 ), T (1 // 5 )])
353+ DDEProblem (f_2delays_long_notinplace, u₀, t -> zero (u₀), (zero (T), T (100 )),
354+ constant_lags = [T (1 // 3 ), T (1 // 5 )])
348355
349356"""
350357 prob_dde_2delays_long_scalar_notinplace
370377Model of blood production with constant delay (M. C. Mackey and L. Glass, Oscillation and
371378chaos in physiological control systems, 1977).
372379"""
373- prob_dde_mackey = DDEProblem (f_dde_mackey, t -> [0.5 ], [0.5 ], (0.0 , 500.0 ), nothing , [14 ])
380+ prob_dde_mackey = DDEProblem (f_dde_mackey, [0.5 ], t -> [0.5 ], (0.0 , 500.0 ),
381+ constant_lags = [14 ])
374382
375383function f_dde_wheldon (du, u, h, p, t)
376384 du[1 ] = 1.1 / (1 + sqrt (10 )* (h (t- 20 )[1 ])^ (5 / 4 )) - 10 * u[1 ]/ (1 + 40 * u[2 ])
@@ -384,7 +392,8 @@ u0_wheldon = [1.05767027/3; 1.030713491/3]
384392Model of chronic granulocytic leukemia with constant delay (T. Wheldon, J. Kirk and
385393H. Finlay, Cyclical granulopoiesis in chronic granulocytic leukemia: A simulation study, 1974).
386394"""
387- prob_dde_wheldon = DDEProblem (f_dde_wheldon, t -> u0_wheldon, u0_wheldon, (0. , 100. ), [20 ])
395+ prob_dde_wheldon = DDEProblem (f_dde_wheldon, u0_wheldon, t -> u0_wheldon, (0. , 100. ),
396+ constant_lags = [20 ])
388397
389398function f_dde_neves1 (du, u, h, p, t)
390399 du[1 ] = 1 - h (exp (1 - 1 / t))[1 ]
401410DDE with vanishing time dependent delay at ``t = 1`` (K. W. Neves, Automatic integratorion
402411of functional differential equations: An approach, 1975).
403412"""
404- prob_dde_neves_1 = DDEProblem (f_dde_neves1, t -> [log (t )], [log (0.1 )], (0.1 , 10. ), [] ,
405- nothing , [(t, u ) -> t - exp (1 - 1 / t)])
413+ prob_dde_neves_1 = DDEProblem (f_dde_neves1, [log (0.1 )], t -> [log (t )], (0.1 , 10. ),
414+ dependent_lags = [(u,p,t ) -> t - exp (1 - 1 / t)])
406415
407416function f_dde_neves_thompson (du, u, h, p, t)
408417 if h (t/ 2 )[1 ] < 0
@@ -446,8 +455,8 @@ u(t) = 1
446455
447456for ``t \\ leq 0``.
448457"""
449- prob_dde_neves_thompson = DDEProblem (f_dde_neves_thompson, t -> [1. ], [1. ], (0. , 2 * log (66 )),
450- nothing , [], [(t, u ) -> t/ 2 ])
458+ prob_dde_neves_thompson = DDEProblem (f_dde_neves_thompson, [1. ], t -> [1. ], (0. , 2 * log (66 )),
459+ constant_lags = [(u,p,t ) -> t/ 2 ])
451460
452461function f_dde_paul1 (du, u, h, p, t)
453462 du[1 ] = - 2 * h (t - 1 - abs (u[1 ]))[1 ]* (1 - u[1 ]^ 2 )
@@ -471,8 +480,8 @@ u(t) = 1/2
471480
472481for ``t \\ leq 0``.
473482"""
474- prob_dde_paul1 = DDEProblem (f_dde_paul1, t -> [0.5 ], [0.5 ], (0. , 30. ), nothing , [] ,
475- [(t, u ) -> 1 + abs (u[1 ])])
483+ prob_dde_paul1 = DDEProblem (f_dde_paul1, [0.5 ], t -> [0.5 ], (0. , 30. ),
484+ dependent_lags = [(u,p,t ) -> 1 + abs (u[1 ])])
476485
477486function f_dde_paul2 (du, u, h, p, t)
478487 h1 = h (t - u[2 ])[1 ]
485494
486495DDE with state dependent delay (C. A. H. Paul, A test set of functional differential equations, 1994).
487496"""
488- prob_dde_paul2 = DDEProblem (f_dde_paul2, t -> [1 ; 0.5 ], [1 ; 0.5 ], (0. , 30. ), nothing , [] ,
489- [(t, u ) -> u[2 ]])
497+ prob_dde_paul2 = DDEProblem (f_dde_paul2, [1 ; 0.5 ], t -> [1 ; 0.5 ], (0. , 30. ),
498+ dependent_lags = [(u,p,t ) -> u[2 ]])
490499
491500function build_prob_dde_mahaffy (tspan, h, σ₀, T₁, γ, Q, k, a, K, r)
492501 function f (du, u, h, p, t)
@@ -495,7 +504,9 @@ function build_prob_dde_mahaffy(tspan, h, σ₀, T₁, γ, Q, k, a, K, r)
495504 du[3 ] = 1 - Q* exp (γ* u[3 ])/ (σ₀* h (t- T₁- u[3 ])[2 ])
496505 end
497506
498- DDEProblem (f, h, h (0 ), tspan, nothing , [T₁], [(t, u) -> T₁ + u[3 ]])
507+ DDEProblem (f, h (0 ), h, tspan,
508+ constant_lags = [T₁],
509+ dependent_lags = [(u,p,t) -> T₁ + u[3 ]])
499510end
500511
501512function h_mahaffy1 (t)
534545DDE with vanishing state dependent delay at ``t = 1`` (K. W. Neves, Automatic integration
535546of functional differential equations: An approach, 1975).
536547"""
537- prob_dde_neves2 = DDEProblem (f_dde_neves2, t -> [log (t ); 1 / t ], [log (0.1 ); 10 ], (0.1 , 5. ),
538- nothing , [], [(t, u ) -> t - exp (1 - u[2 ])])
548+ prob_dde_neves2 = DDEProblem (f_dde_neves2, [log (0.1 ); 10 ], t -> [log (t ); 1 / t ], (0.1 , 5. ),
549+ dependent_lags = [(u,p,t ) -> t - exp (1 - u[2 ])])
539550
540551function build_f_dde_gatica (r₁, r₂, α, δ)
541552 function f_dde_gatica (du, u, h, p, t)
558569Model of antigen antibody dynamics with fading memory, with vanishing state dependent delay
559570at ``t = 0`` (J. Gatica and P. Waltman, A threshold model of antigen antibody dynamics with fading memory, 1982).
560571"""
561- prob_dde_gatica = DDEProblem (build_f_dde_gatica (0.02 , 0.005 , 3 , 0.01 ), t -> [5 ; 0.1 ; 0 ; 0 ],
562- [5 ; 0.1 ; 0 ; 0 ], (0. , 40. ), nothing , [], [(t, u) -> u[4 ]])
572+ prob_dde_gatica = DDEProblem (build_f_dde_gatica (0.02 , 0.005 , 3 , 0.01 ),
573+ [5 ; 0.1 ; 0 ; 0 ], t -> [5 ; 0.1 ; 0 ; 0 ],
574+ (0. , 40. ), dependent_lags = [(u,p,t) -> u[4 ]])
563575
564576#=
565577Quorum Sensing model
@@ -611,7 +623,7 @@ function build_prob_dde_qs(u₀, tspan, τ, D, γₛ, Kₘ, nₛ, a, αₐ, β
611623 end
612624 end
613625
614- DDEProblem (f_dde_qs, t -> u₀, u₀, tspan, nothing , [τ])
626+ DDEProblem (f_dde_qs, u₀, t -> u₀, tspan, constant_lags = [τ])
615627end
616628
617629"""
0 commit comments