source: mso/sample/miscellaneous/sample_arrays2.mso @ 113

Last change on this file since 113 was 83, checked in by Paula Bettio Staudt, 16 years ago

Updated miscelaneous sample files header

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.3 KB
RevLine 
[83]1#*-------------------------------------------------------------------
2* EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
[1]3*
[83]4* This LIBRARY is free software; you can distribute it and/or modify
5* it under the therms of the ALSOC FREE LICENSE as available at
6* http://www.enq.ufrgs.br/alsoc.
7*
8* EMSO Copyright (C) 2004 - 2007 ALSOC, original code
9* from http://www.rps.eng.br Copyright (C) 2002-2004.
10* All rights reserved.
11*
12* EMSO is distributed under the therms of the ALSOC LICENSE as
13* available at http://www.enq.ufrgs.br/alsoc.
14*
[1]15*----------------------------------------------------------------------
16* Author: Rafael de Pelegrini Soares
17* $Id: sample_arrays2.mso 83 2006-12-08 20:29:34Z paula $
18*--------------------------------------------------------------------*#
19
20
21Model Arrays
22        PARAMETERS
23        Dimension  as Integer(Brief="Integer dimension", Default=3);
24        Scalar as Real(Default=1);
25
26        VARIABLES
27        Var1(Dimension,Dimension) as Real(Default=1);
28        Var2(Dimension,Dimension) as Real(Default=1);
29
30        EQUATIONS
31
[32]32        diff(Var1(1,1))*"s" = Var2(1,2);
[1]33       
34        for i in [2 : Dimension-1]
[32]35                diff(Var1(1,i))*"s" = Var2(1,i-1)+Var2(1,i+1);
[1]36        end
37
[32]38        diff(Var1(1,Dimension))*"s" = Var2(1,Dimension);
39        diff(Var1(2:Dimension,:))*"s" = Scalar*Var2(2:Dimension,:);
[1]40
[32]41        exp(Scalar)*Var2 = sin(time/"s");
[1]42end
43
44FlowSheet SampleArrays
45
46        DEVICES
47        dev1 as Arrays;
48
49        INITIAL
50        dev1.Var1 = -1;
51
52        OPTIONS
53        time = [0:0.1:2*3.1415];
54end
Note: See TracBrowser for help on using the repository browser.