[sage-support] numerical approximation with units of measurement?

2014-06-05 Thread Hal Snyder
Is there a preferred way of taking numerical approximation of a quantity in Sage with units of measure? Here is a contrived example: r = 123/47 * units.length.meter r area = pi * r^2 area output: 123/47*meter 15129/2209*pi*meter^2 Now imagine that r is not a literal but the result of other

[sage-support] Numerical approximation of ceiling functions?

2013-04-23 Thread Kenneth Lin
Hi Sage, I'm not sure if it's that I'm not doing this right, but I have this function that has a ceiling in it. I defined it like so: botrk(h0_prime, a0, s0, c0) = h0_prime / ceil(log(20 * (a0 + 25) / (h0_prime + 20 * (a0 + 25)), 0.95)) * (s0 + 0.4) * (1 + c0) But it won't do approximations

[sage-support] Numerical approximation of symbolic coefficients

2012-02-05 Thread Michael Orlitzky
I've got these polynomials in two variables, `x`, and `u`. The polynomials are low degree (eight at the moment), but I'm working symbolically, so they print exactly: ..+ 314069483520)*sqrt(3) - 80295755776*x + 4831838208)/(1953125*x^63 - 73828125*x^61... All I would really like is to

Re: [sage-support] Numerical approximation of symbolic coefficients

2012-02-05 Thread D. S. McNeil
First attempt: loop through each term and try to n() the coefficient. Madness. Based on a suggestion Mike Hansen once gave me -- http://ask.sagemath.org/question/411/substituting-expressions-for-numbers -- I tend to use subclasses of Converter when I need to do something like this, so as not to

[sage-support] numerical approximation in sage.

2009-11-27 Thread Yotam Avital
Hello. In the tutorials there is an example for numerical approximation: var('x y p q') (x, y, p, q) eq1 = p+q==9 eq2 = q*y+p*x==-6 eq3 = q*y^2+p*x^2==24 solns = solve([eq1,eq2,eq3,p==1],p,q,x,y, solution_dict=True) [[s[p].n(30), s[q].n(30), s[x].n(30), s[y].n(30)] for s in solns] [[1.000,

Re: [sage-support] numerical approximation in sage.

2009-11-27 Thread Minh Nguyen
Hi Yotam, On Sat, Nov 28, 2009 at 5:03 AM, Yotam Avital yota...@gmail.com wrote: SNIP As I far as I can understand, solution_dict tells sage that I want the output to be in dictionary form(that is, {x:1, y:8 ...}) Yes, you're right. I also know that the .n(30) tell sage I want the answer

[sage-support] Numerical approximation

2009-05-02 Thread Fidel
Hello, I think I tried to post this about an hour ago, but the discussion didn't show up. So I'm doing it again, sorry in case it is repeated. I am working in sage 3.4.1 I am trying to define a function to get the LaTeX string of a graph, so I am trying to convert a number to string. I have