There's more than one way to do things | |
PerlMonks |
Re: RK4 for a vectorial functionby bliako (Monsignor) |
on Nov 26, 2021 at 08:33 UTC ( [id://11139139]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|