[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: trivial calculator problem
From: |
Ralf Hemmecke |
Subject: |
Re: trivial calculator problem |
Date: |
Mon, 3 May 2021 08:30:48 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 |
> solve(impedance = 1 / (2 * %pi * frequency * capacitance))
>
>
> I get result:
>
> 1
> (3) [capacitance= ------]
> 106%pi
>
> Can you please tell, how can I get result as floating point value
> instead ?
(12) -> res := solve(impedance = 1 / (2 * %pi * frequency * capacitance))
1
(12) [capacitance = --------]
1060 %pi
Type: List(Equation(Expression(Integer)))
Look at the result type. You take the first of this list.
(13) -> res.1
1
(13) capacitance = --------
1060 %pi
Type: Equation(Expression(Integer))
and the right-hand side of it.
(14) -> rhs(res.1)
1
(14) --------
1060 %pi
Type: Expression(Integer)
Unfortunately, conversion to Float does not work directly. But you can
do it via
(16) -> rhs(res.1)::Expression(Float)
(16) 0.0003002923_4545640629_39
Type: Expression(Float)
(17) -> rhs(res.1)::Expression(Float)::Float
(17) 0.0003002923_4545640629_39
Type: Float
Or convert first to a list of equations over floating point expressions
(18) -> fres := res :: List(Equation(Expression(Float)))
(18) [capacitance = 0.0003002923_4545640629_39]
Type: List(Equation(Expression(Float)))
and then single out the parts as above.
> Also question: I red that FriCAS is supposedly refactored and improved
> version of AXIOM. Are there any reasons for sticking with AXIOM ?
That depends on what you want. AXIOM follows another development
direction than FriCAS. Most probably for what you are doing either of
the two alone is sufficient. They share a very big code base.
> Is there some disagreement in the community which one is better ?
The disagreement was rather in the way how further development on the
system should be done. Choose one and be done. The respective developers
will certainly favour their own system, otherwise they would not develop
different forks. So you should rather ask other users of the system why
they prefer this or that system.
Ralf