Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

RIF range not reflected in (half)numeric output

This is my worksheet: https://cocalc.com/share/f7766c5e-2f4d-4916-bb0d-74a7182e5fd5/2019-02-09-203517.sagews?viewer=share

I have an equation that I insert some numeric values into. Because I need to estimate the range of uncertainty, I specify the values as RIF numbers:

d[0].subs(
        d_e == RIF(.999,1.001),
        x ==.25,
        d_m == RIF(.05,.15),
        U == RIF(10^-9,1.02*10^-9),
        e_m == e_0 * RIF(80.5,81.5),
        e_s == e_0 * RIF(3,4)
    )

However, in the output that range is not expressed. Is that becaues there are remaining symbolic parameters?

RIF range not reflected in (half)numeric output

This is my worksheet: https://cocalc.com/share/f7766c5e-2f4d-4916-bb0d-74a7182e5fd5/2019-02-09-203517.sagews?viewer=share

I have an equation that I insert some numeric values into. Because I need to estimate the range of uncertainty, I specify the values as RIF numbers:

d[0].subs(
        d_e == RIF(.999,1.001),
        x ==.25,
        d_m == RIF(.05,.15),
        U == RIF(10^-9,1.02*10^-9),
        e_m == e_0 * RIF(80.5,81.5),
        e_s == e_0 * RIF(3,4)
    )

However, in the output that range is not expressed. Is that becaues there are remaining symbolic parameters?

Unable to calculate numeric output of calculation with RIFs? Bug?

reworked question, same worksheet in cocalc.

this is my code:

g=solve(e_Ersatz/(2*d_k)==e_s/d_e, d_k)
print g
show(g[0].subs({
        d_e: RIF(.999,1.001),
        d_m: RIF(.25,.1),
        e_m: e_0 * RIF(80.5,81.5),
        e_s: e_0 * RIF(3,4)
    }))
f=g[0].subs({
        d_e: RIF(.999,1.001),
        d_m: RIF(.25,.1),
        e_m: e_0 * RIF(80.5,81.5),
        e_s: e_0 * RIF(3,4)
    })
#show( n(f) )

this is g:

[
d_k == (d_e*d_m*e_m - (d_e*d_m + 2*d_m^2)*e_s)/(d_e*e_m - 2*d_m*e_s)
]

So its not really complicated, a little summation, some factors, a square. Nothing I could not do manually, even with the error propagtion.

But when trying to get the RIF range not reflected in (half)numeric output

equvalent I get

*** WARNING: Code contains possible implicit multiplication    ***
*** Check if any of [ 5e, 5e ] need a "*" sign for multiplication, e.g. 5x should be 5*x ! ***

Error in lines 82-82
Traceback (most recent call last):
  File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1188, in execute
    flags=compile_flags) in namespace, locals
  File "", line 1, in <module>
  File "/ext/sage/sage-8.6_1804/local/lib/python2.7/site-packages/sage/misc/functional.py", line 1419, in numerical_approx
    return n(prec, algorithm=algorithm)
  File "sage/symbolic/expression.pyx", line 5981, in sage.symbolic.expression.Expression.numerical_approx (build/cythonized/sage/symbolic/expression.cpp:34636)
    raise TypeError("cannot evaluate symbolic expression numerically")
TypeError: cannot evaluate symbolic expression numerically

Hu? Am I missing something fundamental? Is this a bug?

================ old question:

This is my worksheet: https://cocalc.com/share/f7766c5e-2f4d-4916-bb0d-74a7182e5fd5/2019-02-09-203517.sagews?viewer=share

I have an equation that I insert some numeric values into. Because I need to estimate the range of uncertainty, I specify the values as RIF numbers:

d[0].subs(
        d_e == RIF(.999,1.001),
        x ==.25,
        d_m == RIF(.05,.15),
        U == RIF(10^-9,1.02*10^-9),
        e_m == e_0 * RIF(80.5,81.5),
        e_s == e_0 * RIF(3,4)
    )

However, in the output that range is not expressed. Is that becaues there are remaining symbolic parameters? parameters?