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
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
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
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
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,
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
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