Nasser wrote:
>
> newbie here.
> I can't figure how to tell fricas to output result of command in 1D plain
> text, instead of the default 2D.
>
> I tried all combinations of the )set output commands, but nothing is
> working for me. All I want, is that instead of
>
> integrate(sin(x)*cos(x),x)
>
> 2
> cos(x)
> - -----------
> 2
>
> is to get
>
>
> - cos(x)^2/2
>
> Spend 30 minutes, reading docs, googling, and I can't find one example how
> to do this. Closest I found is
>
> (7) -> )set output algebra off
> (7) -> )set output fortran on
> (7) -> integrate(sin(x)*cos(x),x)
>
> R7=-DCOS(x)**2/2
>
> But I do not want fortran format. I just want 1D format instead of 2D for
> standard algebra.
>
> Please show me the complete commands to use, as I am very new to axiom and
> fricas
> and assume I know nothing about the system.
Unfortunately, normal output routines always produce 2D output.
Linear output can be obtained via 'unparse':
(1) -> ii := integrate(sin(x)*cos(x),x)
2
cos(x)
(1) - -------
2
Type: Union(Expression(Integer),...)
(2) -> unparse(ii::InputForm)
(2) "((-1)*cos(x)^2)/2"
Type: String
(3) -> ((-1)*cos(x)^2)/2
2
cos(x)
(3) - -------
2
Type: Expression(Integer)
Note: result of 'unparse' when given back to FriCAS is supposed
to produce orignal value. To make sure that result can be
parsed correctly 'unparse' may add extra parenthesis (sometimes
unnecessary).
--
Waldek Hebisch
--
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.