MathJax TeX Test Page \[ \{ x_j^{(r)} \mid 0\le r\lt \text{iv}(j),\quad j=1:n \} \quad\text{or}\quad \{ x_j^{\left(\lt\text{iv}(j)\right)},\quad j=1:n \} \quad\text{for short} \]
MathJax TeX Test Page \[ \{ f_i^{(r)} \mid 0\le r\lt \text{constr}(i),\quad i=1:n \} \quad\text{or}\quad \{ f_i^{\left(\lt \text{constr}(i)\right)},\quad i=1:n \} \quad\text{for short} \]

Identifying initialization data and constraints

We show here how to use printInitData() and printConstr() to identify variables/derivatives that need initial values and set of constraints. To obtain such information in a compact form, use getInitData() and getConstr(), respectively.

iv = getInitData(sadata)

  • returns an array iv that indicates the initialization data
  • The variables/derivatives in the following set need to be initialized:

constr = getConstr(sadata)

  • returns an array constr that indicates the set of constraints:

Example: See the formulation of mod2pend.m DAE here .

G = 9.81; L = 10; alpha = 0.1; n = 6; 
sadata = daeSA(@mod2pend, n, G, L, alpha);

iv = getInitData(sadata)
constr = getConstr(sadata)

iv =
     2     2     0     1     4     0
constr =
     4     4     6     0     1     3


  • iv(1)=2, so variable x (i.e., x_1) has two derivatives (including the 0th) that need to be initialized, that is, x and x'.
  • The iv reads: x^(<2), y^(<2), u^(<1), v^(<4); cf. results by printInitData() below.
  • constr(1)=4, so f_1 has four derivatives (including the 0th) in the set of constraints, that is, f_1, f'_1, f''_1, f'''_1.
  • The constr reads: f_1^(<4), f_2^(<4), f_3^(<6), f_5^(<1), f_6^(<3); cf. results by printConstr() below.

mod2pend problem

Initialization summary:
x, x', y, y', u, v, v', v'', v'''
f_1, f_1', f_1'', f_1''', f_2, f_2', f_2'', f_2''', f_3, f_3', f_3'', 
f_3''', f_3'''', f_3^(5), f_5, f_6, f_6', f_6''

© Gary Guangning Tan, 2015