ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 09 May 2021 16:46:15 +0200How to format the output of integrate() function when printing?https://ask.sagemath.org/question/57036/how-to-format-the-output-of-integrate-function-when-printing/ I want to compute the integral of a function like this:
fi = -0.000004*x^4*y^3+0.000015*x^4*y^2
print(integrate(fi,x))
It prints:
-(8e-07)*x^5*y^3 + (3e-06)*x^5*y^2
Is there a way to format the output so that:
- it uses normal decimal notation instead of exponential one (-0.0000008 instead of -(8e-07))
- it has a given precision (it will print 0.000001 instead of 0.000001111 for example)
I know how to do this with a single variable but not when displaying what the integrate() function returns.MichaelTheSlavSun, 09 May 2021 16:46:15 +0200https://ask.sagemath.org/question/57036/How to print equations and numbers on a single line:https://ask.sagemath.org/question/36183/how-to-print-equations-and-numbers-on-a-single-line/I am trying to print a string, an equation and a number on the same line using the following form:
B=var('B')
fce=var('fce', latex_name='f_{ce}')
fce=2.80e6 * B
values={B:1.0e5}
print "Electron Gyrofrequency=", show(fce) , "= %0.5e" % fce.substitute(values)
However the output does not show as a single line. Any help would be appreciated.lookin03820Wed, 04 Jan 2017 20:17:37 +0100https://ask.sagemath.org/question/36183/