Skocz do zawartości


Uwaga, ta strona używa Cookies
Stosujemy je, aby ułatwić Tobie korzystanie z naszego serwisu. Pamiętaj, że w każdej chwili możesz zmienić ustawienia dotyczące Cookies w ustawieniach swojej przeglądarki internetowej.
Dowiedz się więcej    
Akceptuję

Slimak

Rejestracja: 01 sie 2012
OFFLINE Ostatnio: dziś, 12:29
-----

Moje tematy

Basic - pomoc w kompilacji

07 marzec 2017 - 18:09

Witam wszystkich czytających,

 

Chciałbym prosić o pomoc w skompilowaniu tego skryptu, który jest napisany w języku basic:

 

10 ‘Computer program (BASIC) for calculation of
20 ‘Predicted Mean Vote (PMV) and Predicted Percentage of Dissatisfied (PPD)
30 ‘in accordance with International Standard, ISO 7730
40 CLS: PRINT "DATA ENTRY" :‘data entry
50 INPUT " Clothing (clo) "; CLO
60 INPUT " Metabolic rate (met) "; MET
70 INPUT " External work, normally around 0 (met) "; WME
80 INPUT " Air temperature (°C) "; TA
90 INPUT " Mean radiant temperature (°C) "; TR
100 INPUT " Relative air velocity (m/s) "; VEL
110 PRINT " ENTER EITHER RH OR WATER VAPOUR PRESSURE BUT NOT BOTH"
120 INPUT " Relative humidity (%) "; RH
130 INPUT " Water vapour pressure (Pa) "; PA
140 DEF FNPS (T) = EXP (16.6536 ‒ 4030.183/(T+235)) :‘saturated vapour pressure, kPa
150 IF PA = 0 THEN PA = RH * 10 * FNPS (TA) :‘water vapour pressure, Pa
160 ICL = .155 * CLO :‘thermal insulation of the clothing in m2K/W
170 M = MET * 58.15 :‘metabolic rate in W/m2
180 W = WME * 58.15 :‘external work in W/m2
190 MW = M – W :‘internal heat production in the human body
200 IF ICL ≤ .078 THEN FCL = 1 + 1.29 * ICL
ELSE FCL = 1.05 + 0.645 * ICL :‘clothing area factor
210 HCF = 12.1 * SQR (VEL) :‘heat transf. coeff. by forced convection
220 TAA = TA + 273 :‘air temperature in Kelvin
230 TRA = TR + 273 :‘mean radiant temperature in Kelvin
240 ‘----------------CALCULATE SURFACE TEMPERATURE OF CLOTHING BY ITERATION -------------------
250 TCLA = TAA + (35.5 ‒ TA) / (3.5 (6.45 * ICL + .1)) :‘first guess for surface temperature of clothing
260 P1 = ICL * FCL :‘calculation term
270 P2 = P1 * 3.96 :‘calculation term
280 P3 = P1 * 100 :‘calculation term
290 P4 = P1 * TAA :‘calculation term
300 P5 = 308.7 ‒ .028 * MW + P2 * (TRA/100) ^4 :‘calculation term
310 XN = TLCA / 100
320 XF = XN
330 N = 0 :‘N: number of iterations
340 EPS = .00015 :‘stop criteria in iteration
350 XF = (XF + XN)/2
360 HCN = 2.38 * ABS (100 * XF – TAA) ^ .25 :‘heat transf. coeff. by natural convection
370 IF HCF > HCN THEN HC = HCF ELSE HC = HCN
380 XN = (P5 + P4 * HC – P2 * XF ^4) / (100 + P3 * HC)
390 N = N + 1
400 IF N > 150 THEN GOTO 550
410 IF ABS (XN – XF) > EPS GOTO 350
420 TCL = 100 * XN – 273 :‘surface temperature of the clothing
430 ‘-----------------------------------------------HEAT LOSS COMPONENTS ------------------------------------------------
440 HL1 = 3.05 * .001 (5733 – 6.99 * MW – PA) :‘heat loss diff. through skin
450 IF MW > 58.15 THEN HL2 = .42 * (MW – 58.15)
ELSE HL2 = 0! :‘heat loss by sweating (comfort)
460 HL3 = 1.7 * .00001 * M * (5867 – PA) :‘latent respiration heat loss
470 HL4 = .0014 * M * (34 – TA) :‘dry respiration heat loss
480 HL5 = 3.96 * FCL * (XN ^4 – (TRA/100 ^4) :‘heat loss by radiation
490 HL6 = FCL * HC * (TCL – TA) :’heat loss by convection
500 ‘----------------------------------------------CALCULATE PMV AND PPD -------------------------------------------------
510 TS = .303 * EXP (– .036 * M) + .028 :‘thermal sensation trans coeff.
520 PMV = TS * (MW – HL1 – HL2 – HL3 – HL4 – HL5 – HL6) :‘predicted mean vote
530 PPD = 100 – 95 * EXP (– .03353 * PMV ^4 – .2179 * PMV ^2) :‘predicted percentage dissat.
540 GOTO 570
550 PMV = 999999!
560 PPD = 100
570 PRINT: PRINT "OUTPUT" :‘output
580 PRINT " Predicted Mean Vote (PMV) : "
;:PRINT
USING "# # . #"; PMV
590 PRINT " Predicted Percent of Dissatisfied (PPD) : "
;:PRINT
USING "# # # . #"; PPD
600 PRINT: INPUT "NEXT RUN (Y/N)"; RS
610 IF (RS = "Y" OR RS = "y") THEN RETURN
620 END

Jest to skopiowana treść z załącznika Polskiej Normy jednak nie mam bladego pojęcia jak to ugryźć. Nie znam nikogo kto by się znał na basicu, a samemu próbując to skompilować cały czas wyrzuca mi błędy.

Jeśli ktoś się w tym orientuje co tu jest nie tak to byłbym bardzo wdzięczny.