Overview
Comment:Fix probs when Nu = 0
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 7e0a33978174fed605938ad3aa60733930adf7f214ed61e83aef13cd58f0c0b5
User & Date: gawthrop@users.sourceforge.net on 2013-11-25 00:54:29
Other Links: branch diff | manifest | tags
Context
2013-11-25
02:54:48
Replace default by Default - default is now reserved in gawk check-in: 501413a38b user: gawthrop@users.sourceforge.net tags: origin/master, trunk
00:54:29
Fix probs when Nu = 0 check-in: 7e0a339781 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2013-10-21
21:24:29
No more core dumps check-in: 386bd47614 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/dae2cse_r from [bcddfece44] to [31b5bf2187].

11
12
13
14
15
16
17



18
19
20
21
22
23
24
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+
+







# Copyright (c) P.J.Gawthrop 1991, 1992, 1994.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.28  2005/09/07 17:04:12  geraint
## Fixes chi for cse representation.
##
## Revision 1.27  2005/03/21 11:50:39  gawthrop
## Don't write an empty cseo file
##
## Revision 1.26  2002/10/28 23:31:21  gawthrop
## Added additional term to MTTEdx to account for zdot terms on
## Right-Hand Side state equations
##
261
262
263
264
265
266
267


268
269
270
271
272
273
274




275
276
277
278
279
280
281
282
283
284


285




286




287
288
289
290
291
292
293
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290

291
292
293
294
295
296
297
298
299

300
301
302
303
304
305
306
307
308
309
310







+
+







+
+
+
+







-


+
+

+
+
+
+
-
+
+
+
+







    MTTGx(i,j) := df(MTTZ(i,1), xj, 1);
  END;
END;

% Find MTTGu;
write "% Find MTTGu;";

IF MTTNu>0 THEN 
BEGIN
matrix MTTGu(MTTNz,MTTNu);
FOR j := 1:MTTNu DO
  BEGIN
  uj := MTTu(j,1);
  FOR i := 1:MTTNz DO
    MTTGu(i,j) := df(MTTZ(i,1), uj, 1);
  END;
END
ELSE
  MTTGu := 0;


%Create E matrices
write "%Create E matrices";

IF MTTNx>0 THEN 
BEGIN
matrix MTTExx(MTTNx,MTTNx); MTTExx := MTTFx*MTTGx;
matrix MTTExu(MTTNx,MTTNu); MTTExu := MTTFx*MTTGu;
matrix MTTEyx(MTTNy,MTTNx); MTTEyx := MTTFy*MTTGx;
matrix MTTE(MTTNx,MTTNx);   MTTE := MTTI - MTTExx;
IF MTTNu>0 THEN 
  matrix MTTExu(MTTNx,MTTNu); MTTExu := MTTFx*MTTGu;
END;
END;

IF MTTNu>0 THEN 
  BEGIN
matrix MTTEyu(MTTNy,MTTNu); MTTEyu := MTTFy*MTTGu;
  matrix MTTEyu(MTTNy,MTTNu); MTTEyu := MTTFy*MTTGu;
  END
ELSE
  MTTEyu := 0;




  %% The following gets rid of the dZs; there must be a better way.
  MTTdZ1 := 0;
  MTTdZ2 := 0;
310
311
312
313
314
315
316

317
318
319
320








321
322
323
324
325
326


327


328
329
330
331
332
333
334
327
328
329
330
331
332
333
334




335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350

351
352
353
354
355
356
357
358
359







+
-
-
-
-
+
+
+
+
+
+
+
+






+
+
-
+
+







  MTTdZ19 := 0;

IF MTTNx>0 THEN 
BEGIN
MTTEdX := MTTdX; %Ie MTTEdX is MTTdX with the dz terms deleted ie EdX.
MTTdX := MTTdXs;  %Restore the symbolic dX

IF MTTNu>0 THEN 
%% Add on input derivative terms
MTTEdX := MTTEdX + MTTExu*MTTdu;
%% Add on output derivative terms
MTTEdx := MTTEdX + MTTEyx*(MTTE^(-1))*MTTEdX;
  %% Add on input derivative terms
  MTTEdX := MTTEdX + MTTExu*MTTdu;
END;

IF MTTNy>0 THEN 
  %% Add on output derivative terms
  MTTEdx := MTTEdX + MTTEyx*(MTTE^(-1))*MTTEdX;
END;
END;


%%%%%MTTY := MTTY + MTTEyx*MTTEdX;
%%% This causes the matrix mismatch
%%% MTTdXs and MTTdu need setting in _def.r file

IF MTTNu>0 THEN 
MTTY := MTTY +  MTTEyu*MTTdu;
  MTTY := MTTY +  MTTEyu*MTTdu;
END;

IF MTTNx>0 THEN 
  MTTY := MTTY + MTTEyx*(MTTE^(-1))*MTTEdX;


END; %%of MTTNz>0


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]