update
This commit is contained in:
parent
1f1ad49427
commit
6f050a029e
2496 changed files with 37609 additions and 3031 deletions
53
Task/Euler-method/REXX/euler-method.rexx
Normal file
53
Task/Euler-method/REXX/euler-method.rexx
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
/* REXX ***************************************************************
|
||||
* 24.05.2013 Walter Pachl translated from PL/I
|
||||
**********************************************************************/
|
||||
Numeric Digits 100
|
||||
T0=100
|
||||
Tr=20
|
||||
k=0.07
|
||||
|
||||
h=2
|
||||
x=t0
|
||||
Call head
|
||||
do t=0 to 100 by 2
|
||||
Select
|
||||
When t<=4 | t>=96 Then
|
||||
call o x
|
||||
When t=8 Then
|
||||
Say '...'
|
||||
Otherwise
|
||||
Nop
|
||||
End
|
||||
x=x+h*f(x)
|
||||
end
|
||||
|
||||
h=5
|
||||
y=t0
|
||||
Call head
|
||||
do t=0 to 100 by 5
|
||||
call o y
|
||||
y=y+h*f(y)
|
||||
end
|
||||
|
||||
h=10
|
||||
z=t0
|
||||
Call head
|
||||
do t=0 to 100 by 10
|
||||
call o z
|
||||
z=z+h*f(z)
|
||||
end
|
||||
Exit
|
||||
|
||||
f: procedure Expose k Tr
|
||||
Parse Arg t
|
||||
return -k*(T-Tr)
|
||||
|
||||
head:
|
||||
Say 'h='h
|
||||
Say ' t By formula By Euler'
|
||||
Return
|
||||
|
||||
o:
|
||||
Parse Arg v
|
||||
Say right(t,3) format(Tr+(T0-Tr)/exp(k*t),5,10) format(v,5,10)
|
||||
Return
|
||||
Loading…
Add table
Add a link
Reference in a new issue