From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_20,FROM_ILLEGAL_CHARS, INVALID_MSGID,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6a21b76bbb3ff299,start X-Google-Attributes: gid103376,public From: joechan@poboxes.com (Joe Chan - �� �~ ��) Subject: [Q] How to do simulation in ADA? Date: 1997/02/26 Message-ID: <5f1dls$gvk@hkpu01.polyu.edu.hk>#1/1 X-Deja-AN: 221559137 Organization: The Hong Kong Polytechnic University Reply-To: joechan@poboxes.com Newsgroups: comp.lang.ada Date: 1997-02-26T00:00:00+00:00 List-Id: Hi, I need to write a ADA program to simulate the operation of a control system which controls the RPM(revolutions per minute) of the turbine in a nuclear power plant. The RPM depends on the pressure(X) and the flow rate of cooling liquid(U). Their relationship can be described by the following equation: RPM = 100(1-10U/X)(1-U/100) There is a optimal operation point(i.e. a fixed value for RPM, X, U) that all the deviations must converage. -at The correction by U is D = 1 - e , where a = U , D = RPM , t = time difference difference -bt The correction by X is F = 1 - e , where b = X , F = RPM , t = time difference difference If both U and X change at the same time, the closer point (absolute value) to the optimal operation point is the new reference point of operation. The initial operation point is X=13, U=0.8 My questions: 1. How to program 3 tasks to sample the RPM, U and X? 2. Generate a random number to decide whether a sampling should start? (Is there any random number geneartor in VAX ADA?) -ct 3. How to program 1 - e ? (Is there any exp function?) 4. Could you tell me which book describes the similar software system? I am a beginner in ADA programming! Any suggestions are welcome! Thank you very much! Joe P.S. Could you also mail your response to me, joechan@poboxes.com