-
Notifications
You must be signed in to change notification settings - Fork 0
/
modelc.m
99 lines (77 loc) · 2.57 KB
/
modelc.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
function [dX, dY, tau, AXY, AYY, BXY, BYY, CXX, CXY, CYX, CYY] = ...
modelc(~)
% modelc defines a coupled RE/RFDE model for eigTMNc.
%
% It defines the model
% x(t) = sum_{k = 1}^{p}
% int_{- tau_{k}}^{- tau_{k - 1}}
% C_{XX}^{(k)}(t, theta) * x(t + theta) d theta
% + A_{XY}(t) * y(t)
% + sum_{k = 1}^{p} B_{XY}^{(k)}(t) * y(t - tau_{k})
% + sum_{k = 1}^{p}
% int_{- tau_{k}}^{- tau_{k - 1}}
% C_{XY}^{(k)}(t, theta) * y(t + theta) d theta
% y(t) = sum_{k = 1}^{p}
% int_{- tau_{k}}^{- tau_{k - 1}}
% C_{YX}^{(k)}(t, theta) * x(t + theta) d theta
% + A_{YY}(t) * y(t)
% + sum_{k = 1}^{p} B_{YY}^{(k)}(t) * y(t - tau_{k})
% + sum_{k = 1}^{p}
% int_{- tau_{k}}^{- tau_{k - 1}}
% C_{YY}^{(k)}(t, theta) * y(t + theta) d theta
% Lines not marked with '% INPUT' should not be changed.
% Mnemonics for parameters.
% par(1) = ...
% par(2) = ...
% ...
% eigTMNc passes the par variable to modelc.
% In case it is necessary because the model definition (not just the
% values of the A**, B** and C** matrices) depends on the parameter
% values, you can replace the ~ in the first line with a variable
% name and use it inside the modelc function.
% Model dimensions: RE...
dX = 1; % INPUT
% ... and RFDE.
dY = 1; % INPUT
% Delays (includes 0 and is sorted: [0 tau_{1} tau_{2} ...]).
tau = [0 1 3]; % INPUT
% Number of nontrivial delays.
p = length(tau) - 1;
% Initialize A** matrices as empty matrices.
AXY = [];
AYY = [];
% Initialize cell arrays for B** and C** matrices as empty matrices.
BXY = cell(p, 1);
BYY = cell(p, 1);
CXX = cell(p, 1);
CXY = cell(p, 1);
CYX = cell(p, 1);
CYY = cell(p, 1);
% Define the model.
% A**'s and B**{*}'s must be function handles taking (t, par) as
% arguments.
% C**{*}'s must be function handles taking (t, theta, par) as
% arguments.
% AXY = @(t, par) []; % INPUT
% AYY = @(t, par) []; % INPUT
% BXY{1} = @(t, par) []; % INPUT
% ...
% BXY{p} = @(t, par) []; % INPUT
% BYY{1} = @(t, par) []; % INPUT
% ...
% BYY{p} = @(t, par) []; % INPUT
% CXX{1} = @(t, theta, par) []; % INPUT
% ...
% CXX{p} = @(t, theta, par) []; % INPUT
% CXY{1} = @(t, theta, par) []; % INPUT
% ...
% CXY{p} = @(t, theta, par) []; % INPUT
% CYX{1} = @(t, theta, par) []; % INPUT
% ...
% CYX{p} = @(t, theta, par) []; % INPUT
% CYY{1} = @(t, theta, par) []; % INPUT
% ...
% CYY{p} = @(t, theta, par) []; % INPUT
% For performance reasons you may want to define subfunctions and
% pass their function handle instead of using anonymous functions.
end