Hello Ralf, 
Thanks so much for your reply and edits to the code, appreciate it a lot!

Reading through the FriCAS book again about the types, I also realised 
using DoubleFloat instead of Float was an act of premature optimisation on 
my part. Either way, 
-> Complex(Float) has FloatingPointSystem 
also gives 
-> false
, which means none of the NumericalQuadrature routines would work as you 
mentioned.

I'd be happy to hear about any workarounds/alternatives  to integrate a 
function with complex outputs in FriCAS.

In the meanwhile I'm thinking of seeing if FriCAS can actually symbolically 
integrate the involved term (even though the textbook says there is no 
analytical solution). 

best,
Thejasvi







On Tuesday, April 13, 2021 at 7:34:13 PM UTC+2 [email protected] wrote:

> Oh... attachment...
>
> On 13.04.21 19:30, Ralf Hemmecke wrote:
> > Welcome Thejasvi,
> > 
> > I cannot probably give you full help, but I modified your .input file a 
> bit.
> > 
> > Note that ++ is for docstrings in .spad files. The usual comment starts
> > with --.
> > 
> > The first thing that I have noticed is that legendreP requires its first
> > argument to be a NonNegativeInteger. Unfortunately, FriCAS does not know
> > that n-1 for n: PositiveInteger would be of type NonNegativeInteger. You
> > have to help FriCAS here, i.e.,
> > 
> > (n-1)::NonNegativeInteger
> > 
> > (See start of the notebook. I have defined a few macros that I usually 
> use.)
> > 
> > Still there is a problem with the aromberg function, but that comes from
> > the fact that its first argument must be of type F->F.
> > 
> > 
> https://fricas.github.io/api/NumericalQuadrature.html#l4e756d65726963616c51756164726174757265-61726f6d62657267
> > 
> > You, however, give a type DoubleFloat -> Complex(DoubleFloat).
> > That cannot work.
> > 
> > Sorry, I have no time now to analyxe further, but according to
> > 
> > F: FloatingPointSystem
> > 
> > for NumericalQuadrature(F), it will probably not work to use
> > Complex(DoubleFloat) since
> > 
> > (9) -> Complex(DoubleFloat) has FloatingPointSystem
> > 
> > (9) false
> > 
> > In other words, aromberg is not available for Complex(DF).
> > 
> > Sorry that I cannot be more clear.
> > 
> > Ralf
> > 
> > PS: Please subscribe to fricas-devel for further discussion.
> > 
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/e9809e2d-72eb-40dc-871f-3dabd1b4d303n%40googlegroups.com.

Reply via email to