marcW wrote:
> hi, i wouldn't know, all I know is that C, Mathematica, php whatever I
> used in my life, i never ran into this.
> sure, it's about formatted output (the distinction between generic
> output and latex(expr) escapes me: I just look at the notebook).
> A filter which processes the result to be printed and trims to a
> desired (printing) precision maybe? would suit everybody I guess.
> It's not even about zeros: all i need is two digits after the dot,
> exceptionally 3 (yes, it's economics, a 2 digit science)
> thanks again


If you don't care about precision (i.e., all numbers are rounded off to 
2-3 digits), then you can declare your numbers this way:


sage: R=RealField(15)
sage: R(pi)
3.142
sage: R(0.6)
0.6000
sage: R(4.8)
4.800


In other words, you're explicitly saying that the precision on the 
numbers is 15 bits (not 53 bits, like usual).

sage: Coef =var('a, b, alpha_A, alpha_B, beta_A, beta_B, k_A, k_B, J, 
R_A,R_B')
sage: R=RealField(15)
sage: values ={a: R(15),b: R(0.006),alpha_A: 
R(3),beta_A:R(4.8),beta_B:R(4.8),k_A:R(0.7),k_B:R(0.375)}
sage: f1 = beta_A/2 * 
J^2*(1/(b+beta_A*R_A+beta_B*R_B)^2+6*b/(2*b+3*beta_A*R_A+3*beta_B*R_B)^3)==2*k_A/R_A^2;
sage: f2 = beta_B/2 * 
J^2*(1/(b+beta_A*R_A+beta_B*R_B)^2-6*b/(2*b+3*beta_A*R_A+3*beta_B*R_B)^3)==2*k_B/R_B^2;
sage: f1
1/2*(1/(R_A*beta_A + R_B*beta_B + b)^2 + 6*b/(3*R_A*beta_A + 
3*R_B*beta_B + 2*b)^3)*J^2*beta_A == 2*k_A/R_A^2
sage: f2
1/2*(1/(R_A*beta_A + R_B*beta_B + b)^2 - 6*b/(3*R_A*beta_A + 
3*R_B*beta_B + 2*b)^3)*J^2*beta_B == 2*k_B/R_B^2
sage: f1v=f1.subs(J=a-alpha_A-alpha_B).subs(values)
sage: f1v
2.400*(alpha_B - 12.00)^2*(1/(4.800*R_A + 4.800*R_B + 0.006000)^2 + 
0.03600/(14.40*R_A + 14.40*R_B + 0.01200)^3) == 1.400/R_A^2
sage:


Jason



-- 
Jason Grout

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to