Overview
Comment: | First version of kernel algorithm |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | origin/master | trunk |
Files: | files | file ages | folders |
SHA3-256: |
2a7104531d5dbf75c1737ab71d5b0439 |
User & Date: | gawthrop@users.sourceforge.net on 2001-02-02 21:35:05 |
Other Links: | branch diff | manifest | tags |
Context
2001-02-03
| ||
13:40:45 | Added explicit MTTNu check-in: 2dc4650985 user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
2001-02-02
| ||
21:35:05 | First version of kernel algorithm check-in: 2a7104531d user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
21:26:30 | *** empty log message *** check-in: 2c77a50aab user: gawthrop@users.sourceforge.net tags: origin/master, trunk | |
Changes
Added mttroot/mtt/bin/trans/dae2ker_r version [d1d098f9c2].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | #!/bin/sh ## Shell script dae2ker_r ## Converts dae to behavioral kernal rep. echo Creating $1_ker.r $SYMBOLIC > dae2ker.log <<EOF % Read the files in "$1_dae.r"; % Substitute for the non-state derivatives FOR i:=1:MTTNz DO BEGIN set(mkid(mttdz,i),s*mttz(i,1)); END; % Create a list algebraic equations set to zero eq_list:={}; v_list:={}; FOR i:=1:MTTNyz DO BEGIN eq_list := append(eq_list, {MTTyz(i,1)=0}); v_list := append(v_list,{mkid(mttui,i)}); END; eq_list; v_list; %Solve for the "unknown" latent variables sol := solve(eq_list,v_list); % Substitute into the manifest variables array FOR i:=1:MTTNy DO BEGIN mtty(i,1) := sub(sol,mtty(i,1)); END; % Eliminate the "external" latent variables eq_list:={}; v_list:={}; FOR i:=1:MTTNy DO BEGIN u_i := mkid(mttu,i); w_i := mkid(mttw,i); eq_list := append(eq_list, {w_i=MTTy(i,1)}); IF i>MTTNu THEN v_list := append({w_i},v_list) ELSE v_list := append({u_i},v_list); END; eq_list; v_list; sol := solve(eq_list,v_list); sol := first(sol); % Pluck out the manifest variable solutions behaviour_list:={}; FOR i:=1:(MTTNy-MTTNu) DO BEGIN soli := first(sol); sol := rest(sol); behaviour := DEN(RHS(soli))*LHS(soli) - NUM(RHS(soli)) = 0; behaviour_list := append(behaviour_list, {behaviour}); END; behaviour_list := behaviour_list; MATRIX MTTR(MTTNy-MTTNu,MTTNy); FOR i:=1:(MTTNy-MTTNu) DO BEGIN FOR j:=1:MTTNy DO BEGIN w_j := mkid(mttw,j); coeffs := coeff(lhs(first(behaviour_list)),w_j); IF length(coeffs)>1 THEN MTTR(i,j) := second(coeff(lhs(first(behaviour_list)),w_j)); END; behaviour_list := rest(behaviour_list); END; %% Now do coefficient matrices OFF NAT; OUT "$1_ker.r"; write "MATRIX MTTR(", MTTNy-MTTNu, ",", MTTNy, ");"; MTTR := MTTR; SHUT "$1_ker.r"; EOF |