Differences From Artifact [bcddfece44]:

To Artifact [31b5bf2187]:


11
12
13
14
15
16
17



18
19
20
21
22
23
24
# Copyright (c) P.J.Gawthrop 1991, 1992, 1994.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## 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
##







>
>
>







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
    MTTGx(i,j) := df(MTTZ(i,1), xj, 1);
  END;
END;

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



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;





%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;


END;




matrix MTTEyu(MTTNy,MTTNu); MTTEyu := MTTFy*MTTGu;







  %% The following gets rid of the dZs; there must be a better way.
  MTTdZ1 := 0;
  MTTdZ2 := 0;







>
>







>
>
>
>







<


>
>

>
>
>
>
|
>
>
>







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 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;
  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
  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


%% Add on input derivative terms
MTTEdX := MTTEdX + MTTExu*MTTdu;



%% Add on output derivative terms
MTTEdx := MTTEdX + MTTEyx*(MTTE^(-1))*MTTEdX;

END;


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


MTTY := MTTY +  MTTEyu*MTTdu;


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


END; %%of MTTNz>0








>
|
|
>
>
>
|
|
>






>
>
|
>







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;
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;
END;

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


END; %%of MTTNz>0


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