Last change
on this file since 32 was
32,
checked in by Argimiro Resende Secchi, 16 years ago
|
clean up.
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Id
|
File size:
1023 bytes
|
Rev | Line | |
---|
[1] | 1 | #*--------------------------------------------------------------------- |
---|
| 2 | * This file is property of the author and cannot be used, copyed |
---|
| 3 | * or modified without permission. |
---|
| 4 | * |
---|
| 5 | * Copyright (C) 2002-2005 the author |
---|
| 6 | *---------------------------------------------------------------------- |
---|
| 7 | * Author: Rafael de Pelegrini Soares |
---|
| 8 | * $Id: sample_arrays2.mso 32 2006-09-23 00:16:00Z arge $ |
---|
| 9 | *--------------------------------------------------------------------*# |
---|
| 10 | |
---|
| 11 | |
---|
| 12 | Model Arrays |
---|
| 13 | PARAMETERS |
---|
| 14 | Dimension as Integer(Brief="Integer dimension", Default=3); |
---|
| 15 | Scalar as Real(Default=1); |
---|
| 16 | |
---|
| 17 | VARIABLES |
---|
| 18 | Var1(Dimension,Dimension) as Real(Default=1); |
---|
| 19 | Var2(Dimension,Dimension) as Real(Default=1); |
---|
| 20 | |
---|
| 21 | EQUATIONS |
---|
| 22 | |
---|
[32] | 23 | diff(Var1(1,1))*"s" = Var2(1,2); |
---|
[1] | 24 | |
---|
| 25 | for i in [2 : Dimension-1] |
---|
[32] | 26 | diff(Var1(1,i))*"s" = Var2(1,i-1)+Var2(1,i+1); |
---|
[1] | 27 | end |
---|
| 28 | |
---|
[32] | 29 | diff(Var1(1,Dimension))*"s" = Var2(1,Dimension); |
---|
| 30 | diff(Var1(2:Dimension,:))*"s" = Scalar*Var2(2:Dimension,:); |
---|
[1] | 31 | |
---|
[32] | 32 | exp(Scalar)*Var2 = sin(time/"s"); |
---|
[1] | 33 | end |
---|
| 34 | |
---|
| 35 | FlowSheet SampleArrays |
---|
| 36 | |
---|
| 37 | DEVICES |
---|
| 38 | dev1 as Arrays; |
---|
| 39 | |
---|
| 40 | INITIAL |
---|
| 41 | dev1.Var1 = -1; |
---|
| 42 | |
---|
| 43 | OPTIONS |
---|
| 44 | time = [0:0.1:2*3.1415]; |
---|
| 45 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.