@@ -47,7 +47,8 @@ function f_1delay(::Type{Val{:analytic}}, u₀, p, t)
47
47
end
48
48
49
49
build_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)])
51
52
52
53
"""
53
54
prob_dde_1delay
@@ -86,7 +87,8 @@ f_1delay_notinplace(::Type{Val{:analytic}}, u0, p, t) = f_1delay(Val{:analytic},
86
87
# ### Vectorized history function
87
88
88
89
build_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)])
90
92
91
93
"""
92
94
prob_dde_1delay_notinplace
@@ -99,7 +101,8 @@ prob_dde_1delay_notinplace = build_prob_dde_1delay_notinplace(1.0)
99
101
# ### Scalar history function
100
102
101
103
build_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)])
103
106
104
107
"""
105
108
prob_dde_1delay_scalar_notinplace
@@ -154,7 +157,8 @@ function f_2delays(::Type{Val{:analytic}}, u₀, p, t)
154
157
end
155
158
156
159
build_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 )])
158
162
159
163
"""
160
164
prob_dde_2delays
@@ -194,8 +198,8 @@ f_2delays_notinplace(::Type{Val{:analytic}}, u0, p, t) =
194
198
# ### Vectorized history function
195
199
196
200
build_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 )])
199
203
200
204
"""
201
205
prob_dde_2delays_notinplace
@@ -208,8 +212,8 @@ prob_dde_2delays_notinplace = build_prob_dde_2delays_notinplace(1.0)
208
212
# ### Scalar history function
209
213
210
214
build_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 )])
213
217
214
218
"""
215
219
prob_dde_2delays_scalar_notinplace
@@ -230,7 +234,8 @@ function f_1delay_long(du, u, h, p, t::T) where T
230
234
end
231
235
232
236
build_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 )])
234
239
235
240
"""
236
241
prob_dde_1delay_long
@@ -263,8 +268,8 @@ function f_1delay_long_notinplace(u, h, p, t::T) where T
263
268
end
264
269
265
270
build_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 )])
268
273
269
274
"""
270
275
prob_dde_1delay_long_notinplace
@@ -275,7 +280,8 @@ in-place function.
275
280
prob_dde_1delay_long_notinplace = build_prob_dde_1delay_long_notinplace (1.0 )
276
281
277
282
build_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 )])
279
285
280
286
"""
281
287
prob_dde_1delay_long_scalar_notinplace
@@ -294,7 +300,8 @@ function f_2delays_long(du, u, h, p, t::T) where T
294
300
end
295
301
296
302
build_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 )])
298
305
299
306
"""
300
307
prob_dde_2delays_long
329
336
# ### Vectorized history function
330
337
331
338
build_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 )])
334
341
335
342
"""
336
343
prob_dde_2delays_long_notinplace
@@ -343,8 +350,8 @@ prob_dde_2delays_long_notinplace = build_prob_dde_2delays_long_notinplace(1.0)
343
350
# ### Scalar history function
344
351
345
352
build_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 )])
348
355
349
356
"""
350
357
prob_dde_2delays_long_scalar_notinplace
370
377
Model of blood production with constant delay (M. C. Mackey and L. Glass, Oscillation and
371
378
chaos in physiological control systems, 1977).
372
379
"""
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 ])
374
382
375
383
function f_dde_wheldon (du, u, h, p, t)
376
384
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]
384
392
Model of chronic granulocytic leukemia with constant delay (T. Wheldon, J. Kirk and
385
393
H. Finlay, Cyclical granulopoiesis in chronic granulocytic leukemia: A simulation study, 1974).
386
394
"""
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 ])
388
397
389
398
function f_dde_neves1 (du, u, h, p, t)
390
399
du[1 ] = 1 - h (exp (1 - 1 / t))[1 ]
401
410
DDE with vanishing time dependent delay at ``t = 1`` (K. W. Neves, Automatic integratorion
402
411
of functional differential equations: An approach, 1975).
403
412
"""
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)])
406
415
407
416
function f_dde_neves_thompson (du, u, h, p, t)
408
417
if h (t/ 2 )[1 ] < 0
@@ -446,8 +455,8 @@ u(t) = 1
446
455
447
456
for ``t \\ leq 0``.
448
457
"""
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 ])
451
460
452
461
function f_dde_paul1 (du, u, h, p, t)
453
462
du[1 ] = - 2 * h (t - 1 - abs (u[1 ]))[1 ]* (1 - u[1 ]^ 2 )
@@ -471,8 +480,8 @@ u(t) = 1/2
471
480
472
481
for ``t \\ leq 0``.
473
482
"""
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 ])])
476
485
477
486
function f_dde_paul2 (du, u, h, p, t)
478
487
h1 = h (t - u[2 ])[1 ]
485
494
486
495
DDE with state dependent delay (C. A. H. Paul, A test set of functional differential equations, 1994).
487
496
"""
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 ]])
490
499
491
500
function build_prob_dde_mahaffy (tspan, h, σ₀, T₁, γ, Q, k, a, K, r)
492
501
function f (du, u, h, p, t)
@@ -495,7 +504,9 @@ function build_prob_dde_mahaffy(tspan, h, σ₀, T₁, γ, Q, k, a, K, r)
495
504
du[3 ] = 1 - Q* exp (γ* u[3 ])/ (σ₀* h (t- T₁- u[3 ])[2 ])
496
505
end
497
506
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 ]])
499
510
end
500
511
501
512
function h_mahaffy1 (t)
534
545
DDE with vanishing state dependent delay at ``t = 1`` (K. W. Neves, Automatic integration
535
546
of functional differential equations: An approach, 1975).
536
547
"""
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 ])])
539
550
540
551
function build_f_dde_gatica (r₁, r₂, α, δ)
541
552
function f_dde_gatica (du, u, h, p, t)
558
569
Model of antigen antibody dynamics with fading memory, with vanishing state dependent delay
559
570
at ``t = 0`` (J. Gatica and P. Waltman, A threshold model of antigen antibody dynamics with fading memory, 1982).
560
571
"""
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 ]])
563
575
564
576
#=
565
577
Quorum Sensing model
@@ -611,7 +623,7 @@ function build_prob_dde_qs(u₀, tspan, τ, D, γₛ, Kₘ, nₛ, a, αₐ, β
611
623
end
612
624
end
613
625
614
- DDEProblem (f_dde_qs, t -> u₀, u₀, tspan, nothing , [τ])
626
+ DDEProblem (f_dde_qs, u₀, t -> u₀, tspan, constant_lags = [τ])
615
627
end
616
628
617
629
"""
0 commit comments