help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to solve a "symbolic" system equation


From: Doug Stewart
Subject: Re: how to solve a "symbolic" system equation
Date: Mon, 20 Jul 2015 11:41:34 -0400



On Mon, Jul 20, 2015 at 11:06 AM, Przemek Klosowski <address@hidden> wrote:
On 07/19/2015 05:48 AM, Leo07nard wrote:
I have a warning during the solution. it is :
"
warning: Using rat() heuristics for double-precision input. 
"
Do you know what is this?


Basically, when you use a number such as 1.0/3.0, it can mean two different things: either 1/3, which is an exact rational, or a floating point number which is not equal to 1/3. Symbolic manipulations prefer the rational representation because it is infinitely precise, but they can't be sure that the user wanted that, hence the warning.

_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave



Here is a way to study what is happening.

syms a  b  

a="1/3"
b=1/3
c=sym("1/3")
d=vpa(1/3)
e=vpa("1/3")

a1=a*7
b1=b*7
c1=c*7
d1=d*7
e1=e*7


the results are:

a = 1/3
b =  0.33333
c = (sym) 1/3
d = (sym) 0.33333333333333331482961625624739
e = (sym) 0.33333333333333333333333333333333
a1 =

   343   329   357

b1 =  2.3333
c1 = (sym) 7/3
d1 = (sym) 2.3333333333333332038073137937317
e1 = (sym) 2.3333333333333333333333333333333


a1 is 7 times the ascii values of the 3 chars     1 / 3


--
DASCertificate for 206392


reply via email to

[Prev in Thread] Current Thread [Next in Thread]