Data update
This commit is contained in:
parent
0df55f9f24
commit
aec8ed51b6
1045 changed files with 18889 additions and 2777 deletions
27
Task/Euler-method/Applesoft-BASIC/euler-method.basic
Normal file
27
Task/Euler-method/Applesoft-BASIC/euler-method.basic
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
100 HOME
|
||||
110 PRINT "Time ";
|
||||
120 FOR S = 0 TO 100.1 STEP 10
|
||||
130 PRINT S; " ";
|
||||
140 NEXT S
|
||||
150 PRINT
|
||||
160 PRINT "Dif eq ";
|
||||
170 FOR S = 0 TO 100.1 STEP 10
|
||||
180 LET T = 20+(100-20)*EXP(-.07*S)
|
||||
190 PRINT LEFT$(STR$(T),5); " ";
|
||||
200 NEXT S
|
||||
210 PRINT
|
||||
220 LET P = 2 : GOSUB 260
|
||||
230 LET P = 5 : GOSUB 260
|
||||
240 LET P = 10 : GOSUB 260
|
||||
250 END
|
||||
260 REM Euler(paso)
|
||||
270 LET S = 0
|
||||
280 LET T = 100
|
||||
290 PRINT "Step ";P; " ";
|
||||
300 FOR S = 0 TO 100 STEP P
|
||||
310 IF S - (S/10) * 10 = 0 THEN PRINT LEFT$(STR$(T),5); " ";
|
||||
320 LET T = T+(P)*(-.07*(T-20))
|
||||
330 IF S > 100 THEN GOTO 350
|
||||
340 NEXT S
|
||||
350 PRINT
|
||||
360 RETURN
|
||||
34
Task/Euler-method/BASIC256/euler-method.basic
Normal file
34
Task/Euler-method/BASIC256/euler-method.basic
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
print "Time ";
|
||||
tiempo = 0.0
|
||||
while tiempo <= 100.1
|
||||
print rjust(string(tiempo), 5); " ";
|
||||
tiempo += 10.0
|
||||
end while
|
||||
print
|
||||
|
||||
print "Dif eq ";
|
||||
tiempo = 0.0
|
||||
while tiempo <= 100.1
|
||||
temperatura = 20.0 + (100.0-20.0) * exp(-0.07*tiempo)
|
||||
print rjust(left(string(temperatura), 5), 5); " ";
|
||||
tiempo += 10.0
|
||||
end while
|
||||
print
|
||||
|
||||
call Euler(2)
|
||||
call Euler(5)
|
||||
call Euler(10)
|
||||
end
|
||||
|
||||
subroutine Euler(paso)
|
||||
tiempo = 0
|
||||
temperatura = 100.0
|
||||
print "Step "; rjust(string(paso), 2); " ";
|
||||
|
||||
while tiempo <= 100
|
||||
if (tiempo mod 10) = 0 then print rjust(left(string(temperatura), 5), 5); " ";
|
||||
temperatura += float(paso) * (-0.07*(temperatura-20.0))
|
||||
tiempo += paso
|
||||
end while
|
||||
print
|
||||
end subroutine
|
||||
39
Task/Euler-method/EasyLang/euler-method.easy
Normal file
39
Task/Euler-method/EasyLang/euler-method.easy
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
TR = 20
|
||||
K = -0.07
|
||||
func analytic T0 t .
|
||||
return TR + (T0 - TR) * pow 2.71828 (K * t)
|
||||
.
|
||||
ytxt = 95
|
||||
proc draw_analytic a b . .
|
||||
color 009
|
||||
move 80 ytxt
|
||||
ytxt -= 5
|
||||
text "analytic"
|
||||
for t = a to b
|
||||
line t analytic 100 t
|
||||
.
|
||||
.
|
||||
drawgrid
|
||||
linewidth 0.3
|
||||
textsize 3
|
||||
draw_analytic 0 100
|
||||
#
|
||||
func newton_cooling temp .
|
||||
return K * (temp - TR)
|
||||
.
|
||||
proc draw_euler y0 a b step col . .
|
||||
color col
|
||||
move 80 ytxt
|
||||
ytxt -= 5
|
||||
text "step: " & step
|
||||
t = a
|
||||
y = y0
|
||||
while t < b
|
||||
line t y
|
||||
t += step
|
||||
y += step * newton_cooling y
|
||||
.
|
||||
.
|
||||
draw_euler 100 0 100 10 900
|
||||
draw_euler 100 0 100 5 555
|
||||
draw_euler 100 0 100 2 090
|
||||
27
Task/Euler-method/GW-BASIC/euler-method.basic
Normal file
27
Task/Euler-method/GW-BASIC/euler-method.basic
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
100 CLS
|
||||
110 PRINT "Time ";
|
||||
120 FOR TIEMPO = 0 TO 100.1 STEP 10
|
||||
130 PRINT USING " ###";TIEMPO;
|
||||
140 NEXT TIEMPO
|
||||
150 PRINT
|
||||
160 PRINT "Dif eq ";
|
||||
170 FOR TIEMPO = 0 TO 100.1 STEP 10
|
||||
180 TEMPERATURA = 20+(100-20)*EXP(-.07*TIEMPO)
|
||||
190 PRINT USING "###.##";TEMPERATURA;
|
||||
200 NEXT TIEMPO
|
||||
210 PRINT
|
||||
220 PASO = 2 : GOSUB 260
|
||||
230 PASO = 5 : GOSUB 260
|
||||
240 PASO = 10 : GOSUB 260
|
||||
250 END
|
||||
260 REM Euler(paso)
|
||||
270 TIEMPO = 0
|
||||
280 TEMPERATURA = 100
|
||||
290 PRINT USING "Step ## ";PASO;
|
||||
300 FOR TIEMPO = 0 TO 100 STEP PASO
|
||||
310 IF (TIEMPO MOD 10) = 0 THEN PRINT USING "###.##";TEMPERATURA;
|
||||
320 TEMPERATURA = TEMPERATURA+(PASO)*(-.07*(TEMPERATURA-20))
|
||||
330 IF TIEMPO > 100 THEN EXIT FOR
|
||||
340 NEXT TIEMPO
|
||||
350 PRINT
|
||||
360 RETURN
|
||||
42
Task/Euler-method/Gambas/euler-method.gambas
Normal file
42
Task/Euler-method/Gambas/euler-method.gambas
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
Public Sub Main()
|
||||
|
||||
Dim tiempo As Float, temperatura As Float
|
||||
|
||||
Print "Time ";
|
||||
tiempo = 0.0
|
||||
While tiempo <= 100.1
|
||||
Print Format$(tiempo, "#######");
|
||||
tiempo += 10.0
|
||||
Wend
|
||||
Print
|
||||
|
||||
Print "Dif eq ";
|
||||
tiempo = 0.0
|
||||
While tiempo <= 100.1
|
||||
temperatura = 20.0 + (100.0 - 20.0) * Exp(-0.07 * tiempo)
|
||||
Print Format$(temperatura, "####.#0");
|
||||
tiempo += 10.0
|
||||
Wend
|
||||
Print
|
||||
|
||||
Euler(2)
|
||||
Euler(5)
|
||||
Euler(10)
|
||||
|
||||
End
|
||||
|
||||
Public Sub Euler(paso As Integer)
|
||||
|
||||
Dim tiempo As Integer = 0
|
||||
Dim temperatura As Float = 100.0
|
||||
|
||||
Print "Step "; Format$(paso, "##"); " ";
|
||||
|
||||
Do While tiempo <= 100
|
||||
If (tiempo Mod 10) = 0 Then Print Format$(temperatura, "####.#0");
|
||||
temperatura += (paso) * (-0.07 * (temperatura - 20.0))
|
||||
tiempo += paso
|
||||
Loop
|
||||
Print
|
||||
|
||||
End Sub
|
||||
37
Task/Euler-method/QBasic/euler-method.basic
Normal file
37
Task/Euler-method/QBasic/euler-method.basic
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
DECLARE SUB Euler (paso AS INTEGER)
|
||||
|
||||
CLS
|
||||
PRINT "Time ";
|
||||
tiempo = 0!
|
||||
WHILE tiempo <= 100.1
|
||||
PRINT USING "######"; tiempo;
|
||||
tiempo = tiempo + 10!
|
||||
WEND
|
||||
PRINT
|
||||
|
||||
PRINT "Dif eq ";
|
||||
tiempo = 0!
|
||||
WHILE tiempo <= 100.1
|
||||
temperatura = 20! + (100! - 20!) * EXP(-.07 * tiempo)
|
||||
PRINT USING "###.##"; temperatura;
|
||||
tiempo = tiempo + 10!
|
||||
WEND
|
||||
PRINT
|
||||
|
||||
Euler (2)
|
||||
Euler (5)
|
||||
Euler (10)
|
||||
END
|
||||
|
||||
SUB Euler (paso AS INTEGER)
|
||||
tiempo = 0
|
||||
temperatura = 100!
|
||||
PRINT USING "Step ## "; paso;
|
||||
|
||||
DO WHILE tiempo <= 100
|
||||
IF (tiempo MOD 10) = 0 THEN PRINT USING "###.##"; temperatura;
|
||||
temperatura = temperatura + paso * (-.07 * (temperatura - 20!))
|
||||
tiempo = tiempo + paso
|
||||
LOOP
|
||||
PRINT
|
||||
END SUB
|
||||
32
Task/Euler-method/True-BASIC/euler-method.basic
Normal file
32
Task/Euler-method/True-BASIC/euler-method.basic
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
SUB euler (paso)
|
||||
LET tiempo = 0
|
||||
LET temperatura = 100
|
||||
PRINT USING "Step ## ": paso;
|
||||
DO WHILE tiempo <= 100
|
||||
IF (REMAINDER(tiempo,10)) = 0 THEN PRINT USING "###.##": temperatura;
|
||||
LET temperatura = temperatura+paso*(-.07*(temperatura-20))
|
||||
LET tiempo = tiempo+paso
|
||||
LOOP
|
||||
PRINT
|
||||
END SUB
|
||||
|
||||
PRINT "Time ";
|
||||
LET tiempo = 0
|
||||
DO WHILE tiempo <= 100.1
|
||||
PRINT USING "######": tiempo;
|
||||
LET tiempo = tiempo+10
|
||||
LOOP
|
||||
PRINT
|
||||
PRINT "Dif eq ";
|
||||
LET tiempo = 0
|
||||
DO WHILE tiempo <= 100.1
|
||||
LET temperatura = 20+(100-20)*EXP(-.07*tiempo)
|
||||
PRINT USING "###.##": temperatura;
|
||||
LET tiempo = tiempo+10
|
||||
LOOP
|
||||
PRINT
|
||||
|
||||
CALL Euler (2)
|
||||
CALL Euler (5)
|
||||
CALL Euler (10)
|
||||
END
|
||||
35
Task/Euler-method/Yabasic/euler-method.basic
Normal file
35
Task/Euler-method/Yabasic/euler-method.basic
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
print "Time ";
|
||||
tiempo = 0.0
|
||||
while tiempo <= 100.1
|
||||
print tiempo using "#######";
|
||||
tiempo = tiempo + 10.0
|
||||
wend
|
||||
print
|
||||
|
||||
print "Dif eq ";
|
||||
tiempo = 0.0
|
||||
while tiempo <= 100.1
|
||||
temperatura = 20.0 + (100.0-20.0) * exp(-0.07*tiempo)
|
||||
print temperatura using "####.##";
|
||||
tiempo = tiempo + 10.0
|
||||
wend
|
||||
print
|
||||
|
||||
Euler_(2)
|
||||
Euler_(5)
|
||||
Euler_(10)
|
||||
end
|
||||
|
||||
sub Euler_(paso)
|
||||
local tiempo, temperatura
|
||||
tiempo = 0
|
||||
temperatura = 100.0
|
||||
print "Step ", paso using "##", " ";
|
||||
|
||||
while tiempo <= 100
|
||||
if mod(tiempo, 10) = 0 print temperatura using "####.##";
|
||||
temperatura = temperatura + (paso) * (-0.07*(temperatura-20.0))
|
||||
tiempo = tiempo + paso
|
||||
end while
|
||||
print
|
||||
end sub
|
||||
Loading…
Add table
Add a link
Reference in a new issue