[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: linear increasing value



Dear Alfred,

If I understand your problem correctly, I think the attached example will do the job. It uses a Type93 (input value recall) and some equations.
The variable called "Value" is linearly increasing with an increment set by variable "Increment" as soon as the variable "Switch" is set to one, and setting "Switch" to 0 resets the integrator.
I also pasted the deck file in this email for quick reference.

Regards,

Michaël Kummert
 
_________________________________________________

Michaël Kummert

Solar Energy Laboratory - University of Wisconsin-Madison
1303 Engr Res Bldg, 1500 Engineering Drive
Madison, WI 53706

Tel: +1 (608) 263-1589
Fax: +1 (608) 262-8464
E-mail: kummert@engr.wisc.edu

SEL Web Site: http://sel.me.wisc.edu
TRNSYS Web Site: http://sel.me.wisc.edu/trnsys



*--- DECK FILE (LINEAR.DCK) : BEGIN ---

VERSION 15

CONSTANTS 3
START=1
STOP=100
STEP=1

SIMULATION START STOP STEP

EQUATIONS 3
Switch = GT(TIME,10)-GT(TIME,20)+GT(TIME,50)-GT(TIME,65)
Increment = 3
Value = ([2,2]+Increment)*Switch

UNIT 2 TYPE 93 Type93
PARAMETERS 2
* 1 Number of inputs to be stored
1
* 2 Number of timesteps to be stored
2
INPUTS 1
Value
0

UNIT 3 TYPE 65 TYPE65b
PARAMETERS 10
* 1 Nb. of left-axis variables
1
* 2 Nb. of right-axis variables
1
* 3 Left axis minimum
0.0
* 4 Left axis maximum
100
* 5 Right axis minimum
0.0
* 6 Right axis maximum
100
* 7 Number of plots per simulation
1
* 8 X-axis gridpoints
7
* 9 Shut off Online w/o removing
0
* 10 Logical Unit for ouput file
20

INPUTS 2
Switch
Value
Switch Value

LABELS 5
- -
-
-
Graph

ASSIGN "Linear.out" 20

END

*--- DECK FILE (LINEAR.DCK) : END ---


Attachment: Linear.zip
Description: Zip compressed data