Overview
Comment:Replaced continuation character in lib m files, except PPP and Control
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: fa2f8429aa8fecd08d3d8ea7e78f6ae62f33f9bd3965f90993294ef9a21823ae
User & Date: geraint@users.sourceforge.net on 2014-08-02 16:36:14
Other Links: branch diff | manifest | tags
Context
2014-08-02
16:48:56
Octave continuation character changed to ellipsis check-in: 293a80c42a user: geraint@users.sourceforge.net tags: origin/master, trunk
16:36:14
Replaced continuation character in lib m files, except PPP and Control check-in: fa2f8429aa user: geraint@users.sourceforge.net tags: origin/master, trunk
2014-07-25
21:31:48
Changed newline escape from backslash to ellipsis in m files check-in: 2e8cbaac42 user: geraint@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/lib/comp/simple/CI_seqn.m from [827c2f1efc] to [2217509088].

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
  delim = "__";
  N = mtt_check_sigs (outsig,insigs);

  state_index=3;
  
  i_cause = outsig(2);		# Extract causality

  state_equation=((i_cause==1)&&strcmp(comp_type,"C"))\
      ||((i_cause==-1)&&strcmp(comp_type,"I"));

  ## Create the equation
  if state_equation			# output/state
    LHS = varname(Name, outsig(1,1), state_index);
    RHS = sprintf("MTTx_%s%s%s", Name, delim, name);
    eqn_1 = sprintf("%s := %s;", LHS, RHS);
    
    inports = [1:N]; 
    comp_type_str=sprintf("""%s""", comp_type);
    eqn_2 = equation(comp_type_str,Name,cr,arg,outsig(1),outsig(2),outsig(3),\
	     insigs(:,1),state_index,inports);
    
    eqn = sprintf("%s\n%s", eqn_1, eqn_2);
  else			# state derivative
    RHS = varname(Name, insigs(1,1), insigs(1,2));
    LHS = sprintf("MTTdx_%s%s%s", Name, delim, name);
    eqn = sprintf("%s := %s;", LHS, RHS);







|










|







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
  delim = "__";
  N = mtt_check_sigs (outsig,insigs);

  state_index=3;
  
  i_cause = outsig(2);		# Extract causality

  state_equation=((i_cause==1)&&strcmp(comp_type,"C")) ...
      ||((i_cause==-1)&&strcmp(comp_type,"I"));

  ## Create the equation
  if state_equation			# output/state
    LHS = varname(Name, outsig(1,1), state_index);
    RHS = sprintf("MTTx_%s%s%s", Name, delim, name);
    eqn_1 = sprintf("%s := %s;", LHS, RHS);
    
    inports = [1:N]; 
    comp_type_str=sprintf("""%s""", comp_type);
    eqn_2 = equation(comp_type_str,Name,cr,arg,outsig(1),outsig(2),outsig(3), ...
	     insigs(:,1),state_index,inports);
    
    eqn = sprintf("%s\n%s", eqn_1, eqn_2);
  else			# state derivative
    RHS = varname(Name, insigs(1,1), insigs(1,2));
    LHS = sprintf("MTTdx_%s%s%s", Name, delim, name);
    eqn = sprintf("%s := %s;", LHS, RHS);

Modified mttroot/mtt/lib/comp/simple/C_eqn.m from [2af3de08f1] to [0e1e88a5f1].

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
%    structure,eqnfile);

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$



% %% Revision 1.2  1997/04/09 13:00:28  peterg
% %% *** empty log message ***
% %%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% Copyright (c) P.J. Gawthrop, 1996.

			
if nargin<8
  eqnfile = 'stdout';
end;

% Unicausal version
CorI = 1;
structure = cieqn(name,bond_number,bonds,direction,cr,args, structure, \
                 CorI, eqnfile);














>
>
>















|








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
%    structure,eqnfile);

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.3  2003/01/07 10:10:14  gawthrop
% %% Uses new version of equation.m - passes component type to cr.
% %%
% %% Revision 1.2  1997/04/09 13:00:28  peterg
% %% *** empty log message ***
% %%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% Copyright (c) P.J. Gawthrop, 1996.

			
if nargin<8
  eqnfile = 'stdout';
end;

% Unicausal version
CorI = 1;
structure = cieqn(name,bond_number,bonds,direction,cr,args, structure, ...
                 CorI, eqnfile);







Modified mttroot/mtt/lib/comp/simple/SS_seqn.m from [b43b9ca4fd] to [96afb2658a].

1
2
3
4
5
6
7
8
function [eqn,insigs,innames] = SS_seqn (Name, name, cr, arg, outsig, \
					 insigs,innames,is_port)

  ## usage:  [eqn,inbonds] = SS_seqn (Name, cr, arg, outbond, inbonds)
  ##
  ## 
  ## Multi port SS's ??

|







1
2
3
4
5
6
7
8
function [eqn,insigs,innames] = SS_seqn (Name, name, cr, arg, outsig, ...
					 insigs,innames,is_port)

  ## usage:  [eqn,inbonds] = SS_seqn (Name, cr, arg, outbond, inbonds)
  ##
  ## 
  ## Multi port SS's ??

Modified mttroot/mtt/lib/comp/simple/Sensor_seqn.m from [4a6bbeb765] to [60348ae058].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function LHS = Sensor_seqn (attribute,name)

  ## usage:  LHS = Sensor_seqn (attribute,name)
  ##
  ## Write the LHS of a sensor equation
  

  if strcmp(attribute,"external")
    LHS = sprintf("MTTy_%s", name);  
  elseif strcmp(attribute,"internal")
    LHS = sprintf("MTTy_%s", name); 
  else
    error(sprintf("attribute ""%s"" not appropriate for a \
    source"), attribute);
  endif
endfunction












|
|


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function LHS = Sensor_seqn (attribute,name)

  ## usage:  LHS = Sensor_seqn (attribute,name)
  ##
  ## Write the LHS of a sensor equation
  

  if strcmp(attribute,"external")
    LHS = sprintf("MTTy_%s", name);  
  elseif strcmp(attribute,"internal")
    LHS = sprintf("MTTy_%s", name); 
  else
    error(sprintf("attribute ""%s"" not appropriate for a " ...
    "source"), attribute);
  endif
endfunction

Modified mttroot/mtt/lib/comp/simple/Source_seqn.m from [de06b8124d] to [7ea4860836].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function RHS = Source_seqn (attribute,name)

  ## usage:  RHS = Source_seqn (attribute,name)
  ##
  ## Write the RHS of a source equation
  
  if strcmp(attribute,"external")
    RHS = sprintf("MTTu_%s",name);
   elseif strcmp(attribute,"internal")
     error(sprintf("attribute ""internal"" not appropriate for a \
 	source"));
  else
    RHS = attribute;
  endif
  
endfunction









|
|





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function RHS = Source_seqn (attribute,name)

  ## usage:  RHS = Source_seqn (attribute,name)
  ##
  ## Write the RHS of a source equation
  
  if strcmp(attribute,"external")
    RHS = sprintf("MTTu_%s",name);
   elseif strcmp(attribute,"internal")
     error(sprintf("attribute ""internal"" not appropriate for a " 
 	"source"));
  else
    RHS = attribute;
  endif
  
endfunction

Modified mttroot/mtt/lib/comp/simple/junction_seqn.m from [3462a7ac23] to [1675df1f08].

1
2
3
4
5
6
7
8
9
10
function [eqn,insigs,innames] = junction_seqn (jun_type,Name, outsig, \
					       insigs, innames)
  ## usage:  [eqn,insigs] = junction_seqn (jun_type,Name, outport, outsig, \
  ##				       insigs)
  ##
  ## 
  ## Junctions

  ## Sanity check
  N = mtt_check_sigs (outsig,insigs);
|

|







1
2
3
4
5
6
7
8
9
10
function [eqn,insigs,innames] = junction_seqn (jun_type,Name, outsig, ...
					       insigs, innames)
  ## usage:  [eqn,insigs] = junction_seqn (jun_type,Name, outport, outsig, ...
  ##				       insigs)
  ##
  ## 
  ## Junctions

  ## Sanity check
  N = mtt_check_sigs (outsig,insigs);
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
    inname="";
    inports = [];
    out_dir = sign(insigs(inport,1));
    for i=1:N
      if i!=inport
	in_dir = sign(insigs(i,1));
	plusminus = sign2name(-in_dir*out_dir);
	eqn = sprintf("%s\n\t%s%s", eqn, plusminus, varname(Name, \
		      abs(insigs(i,1)), -i_jun_type));
	insig = [insig; insigs(i,:)];
	inname = [inname; innames(i,:)];
      endif
    endfor
  endif
  eqn = sprintf("%s;", eqn);
  insigs = insig;
  innames = inname;
endfunction







|










41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
    inname="";
    inports = [];
    out_dir = sign(insigs(inport,1));
    for i=1:N
      if i!=inport
	in_dir = sign(insigs(i,1));
	plusminus = sign2name(-in_dir*out_dir);
	eqn = sprintf("%s\n\t%s%s", eqn, plusminus, varname(Name, ...
		      abs(insigs(i,1)), -i_jun_type));
	insig = [insig; insigs(i,:)];
	inname = [inname; innames(i,:)];
      endif
    endfor
  endif
  eqn = sprintf("%s;", eqn);
  insigs = insig;
  innames = inname;
endfunction


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