Last change
on this file was
944,
checked in by Argimiro Resende Secchi, 9 years ago
|
Adding Block-Oriented library by Jonathan Ospino Pinedo
|
File size:
1.3 KB
|
Rev | Line | |
---|
[944] | 1 | #*------------------------------------------------------------------- |
---|
| 2 | * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC. |
---|
| 3 | * |
---|
| 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 is distributed under the terms of the ALSOC LICENSE as |
---|
| 9 | * available at http://www.enq.ufrgs.br/alsoc. |
---|
| 10 | *----------------------------------------------------------------------- |
---|
| 11 | * Author: Jonathan Ospino P. |
---|
| 12 | * $Id: MultDiv.mso 2012$ |
---|
| 13 | *---------------------------------------------------------------------*# |
---|
| 14 | |
---|
| 15 | using "types"; |
---|
| 16 | |
---|
| 17 | Model MultDiv |
---|
| 18 | |
---|
| 19 | ATTRIBUTES |
---|
| 20 | Pallete=true; |
---|
| 21 | Icon="icon/MultDiv"; |
---|
| 22 | Info="== Multiplication/Division block == |
---|
| 23 | |
---|
| 24 | It takes the input variables and computes the product or division between them. |
---|
| 25 | The resulting value is assigned to the output variable"; |
---|
| 26 | |
---|
| 27 | PARAMETERS |
---|
| 28 | Select_operation as Switcher(Valid=["Product","Division"],Default="Product"); |
---|
| 29 | |
---|
| 30 | VARIABLES |
---|
| 31 | in In1 as Real(Brief="First term",PosX=0.5,PosY=0); |
---|
| 32 | in In2 as Real(Brief="Second term",PosX=0.5,PosY=1); |
---|
| 33 | out Out as Real(Brief="Result is (In1*In2) or (In1/In2)",PosX=1,PosY=0.5,Protected=true); |
---|
| 34 | |
---|
| 35 | EQUATIONS |
---|
| 36 | switch Select_operation |
---|
| 37 | case "Product": |
---|
| 38 | Out=In1*In2; |
---|
| 39 | case "Division": |
---|
| 40 | Out=In1/In2; |
---|
| 41 | end |
---|
| 42 | |
---|
| 43 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.