In Fricas, I can use the )set messages time on to see the time taken by
integrate. But how do I set a time-out, and also how to I know if
integrate finished due to time-out or not, and how do I capture the
time-used (EV) in a variable?
I am trying to do all this using a script. Non-interactive. So everything
has to be done by code in Fricas.
For example. if I do
(3) -> )set messages time on
(3) -> ii:=integrate(1/(x*(3*x^2 - 6*x + 4)^(1/3)),x);
Type:
Union(Expression(Integer),...)
Time: 0.00 (IN) + 240.79 (EV) + 0.00 (OT) = 240.80
sec
SO the above took 240 seconds. How to capture this value EV in variable so
I can record it to a file?
And what if I want to set time-out of say 200 seconds. How to do that? And
how to know if integrate returned due to time-out or not?
For example, in Mathematica, I can do the following
result = AbsoluteTiming[TimeConstrained[Integrate[integrand,x]], timeOut]];
result will return 2 fields. The first is the time used, and the second
field is the actual result from integrate (anti-derivative or the same
input if unable to do it).
If however it timedOut, the second field will instead contain $Abort, so I
can check as follows
If[res[[2]] === $Aborted, (*timed out *)
....
How could something similar be done in Fricas?
Thanks,
--Nasser
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.