Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Runge-Kutta-method/PureBasic/runge-kutta-method.basic
Normal file
19
Task/Runge-Kutta-method/PureBasic/runge-kutta-method.basic
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
EnableExplicit
|
||||
Define.i i
|
||||
Define.d y=1.0, k1=0.0, k2=0.0, k3=0.0, k4=0.0, t=0.0
|
||||
|
||||
If OpenConsole()
|
||||
For i=0 To 100
|
||||
t=i/10
|
||||
If Not i%10
|
||||
PrintN("y("+RSet(StrF(t,0),2," ")+") ="+RSet(StrF(y,4),9," ")+#TAB$+"Error ="+RSet(StrF(Pow(Pow(t,2)+4,2)/16-y,10),14," "))
|
||||
EndIf
|
||||
k1=t*Sqr(y)
|
||||
k2=(t+0.05)*Sqr(y+0.05*k1)
|
||||
k3=(t+0.05)*Sqr(y+0.05*k2)
|
||||
k4=(t+0.10)*Sqr(y+0.10*k3)
|
||||
y+0.1*(k1+2*(k2+k3)+k4)/6
|
||||
Next
|
||||
Print("Press return to exit...") : Input()
|
||||
EndIf
|
||||
End
|
||||
Loading…
Add table
Add a link
Reference in a new issue