Data update
This commit is contained in:
parent
0df55f9f24
commit
aec8ed51b6
1045 changed files with 18889 additions and 2777 deletions
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue