Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: RK4 for a vectorial function

by bliako (Monsignor)
on Nov 26, 2021 at 08:33 UTC ( [id://11139139]=note: print w/replies, xml ) Need Help??


in reply to RK4 for a vectorial function

for 0<t<25 I get beautiful oscillations in columns 3 and 4 of the output file

side remark: You don't need to declare subs k1_1 etc. as variables (e.g. my $k1_1;) (and you could also implement them outside the RK4_... subs, EDIT: did you mean to use them as closures? you don't seem to because you pass them the important params and step is "global" in their scope). EDIT: also you can stop calling subs using the &mysub() notation, instead mysub() is valid.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11139139]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-20 13:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found