ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 15 Apr 2020 06:43:24 -0500Unexpected result in calculating limitshttp://ask.sagemath.org/question/50767/unexpected-result-in-calculating-limits/Limit of `sqrt(x-3)` when `x` approaches `3` doesn't exist but the sage returns `0`. Why is that?
sage:
sage: limit(sqrt(x-3), x=3)
0
sage:
ggWed, 15 Apr 2020 06:43:24 -0500http://ask.sagemath.org/question/50767/Sage returning wrong derivativehttp://ask.sagemath.org/question/50704/sage-returning-wrong-derivative/I am trying to calculate the derivative of `y = e^(x*y)`
Hand calculation give me the result of `dy/dx = ( y*e^(x*y) ) / ( 1 - x*e^(x*y) )`
But the sage is giving me the wrong output of `-y/x`. Here is my code:
sage:
sage: y=function('y')(x)
sage: y
y(x)
sage:
sage: expr = exp(1)**(x*y)
sage:
sage: diff(y)
diff(y(x), x)
sage:
sage: diff(expr)
(x*diff(y(x), x) + y(x))*e^(x*y(x))
sage:
sage: solve(diff(expr), diff(y))
[diff(y(x), x) == -y(x)/x]
sage:
sage:
ggSun, 12 Apr 2020 12:25:28 -0500http://ask.sagemath.org/question/50704/How are symbolic derivatives composed in quaternions?http://ask.sagemath.org/question/49785/how-are-symbolic-derivatives-composed-in-quaternions/The scripts below were run in: Sage Cell Server, version: 'SageMath version 9.0, Release Date: 2020-01-01'
I am a new user of SageMath. I have previously used math packages, but SageMath is above and beyond all I have encountered before. It also has remarkably comprehensive documentation. In particular I have found Vector calculus with SageMath and Sage Reference Manual: Quaternion Algebras (insufficient karma to post links). I note that the latter is dated Jan 01, 2020. The examples below are drawn from those two sources. I am searching for calculus tools in the quaternion algebra package. I want to do something like this, which works in EuclideanSpace:
Sage: %display latex
Sage: from sage.manifolds.operators import *
Sage: E.<x,y,z> = EuclideanSpace()
Sage: F = E.scalar_field(function('f')(x,y,z), name='F')
Sage: grad(F).display()
grad(F) = d(f)/dx e_x + d(f)/dy e_y + d(f)/dz e_z The EucliedanSpace also knows how to pretty-print it with LaTeX.
This is as close as I have gotten with quaternions:
Sage: N.<a,b,c,d,y> = QQ[]
Sage: Q.<i,j,k> = QuaternionAlgebra(SR,-1,-1)
Sage: def qd(u):
Sage: w = j*(diff(u[0],y) + diff(u[1],y)*i + diff(u[2],y)*j + diff(u[3],y)*k)
Sage: return w
Sage: b = sin(y)
Sage: f = a+b*i+c*j+d*k
Sage: t = qd(f)
Sage: show(t)
(-cos(y))*k
This is the correct quaternion result, but I want to change the declaration of "b" so that I get something like
**(-d(f)/dy) * k**. Here are the problems that concern me.
1. "diff" does not correctly handle "f" as an argument. It returns 0.
2. The definition in the function "qd" (quaternion derivative) of w should contain 3 more rows, but this one is enough to illustrate my main issue: If "b" is not defined as a specific function (e.g. sin(y)), "diff" returns 0. I would like it to return the derivative display formula, as the Euclidean example does.
3. Replacing show(t) with t.display() returns error messages such as "object has no attribute 'blah_blah'" and "raise AttributeError(dummy_error_message)." There may still be some work in progress here.
I hope there is presently a solution within SageMath. Please adapt the second script or give me an example script.
If not, I am reasonably competent with Python 3. If someone can give me links to the relevant source for the EuclideanSpace methods of "grad" and "function" and to the QuaternionAlgebra source for "diff," I may be able to add a method or two to the QuaternionAlgebra implementation and advance the development of that part of the system, or at least register myself as a beta-tester.
Thanks very much for any help you can give me!
quirkyTue, 04 Feb 2020 13:31:21 -0600http://ask.sagemath.org/question/49785/symbolic differentiation of unknown functionhttp://ask.sagemath.org/question/49362/symbolic-differentiation-of-unknown-function/I want to do some formal calculus with unknown functions
for the purpose of solving differential equations.
Say `F(t) = v(t)*t^2`, where `v` is an unknown differentiable function.
Then I would like to declare `v` as such and be able to get
`F.diff(t) = 2*t*v+t^2*v.diff(t)`
It is similar to [Ask Sage question 8822](https://ask.sagemath.org/question/8822)
but the solution does not seem to work anymore, as `function()` takes
only one argument and not 2 as in the description.
Anyone know what the syntax is in 8.9? Or in 9.0, when that becomes available?asgerSat, 04 Jan 2020 14:10:03 -0600http://ask.sagemath.org/question/49362/Is there any way to define an as-yet-unknown function?http://ask.sagemath.org/question/8822/is-there-any-way-to-define-an-as-yet-unknown-function/I'd like to know if there's a way of declaring functions in sage that are as-yet unknown. For example, let's say I have a function
p = R*T/v - a(T)/v/(v+b)
And I would like to be able to take a derivative like this
deriv(p,T)
and be given something back a partial derivative something like
R/v - diff(a(T),T)/v/(v+b)
However at present I can't seem to put an abstract function `a(T)` into my expression or find anything in the documentation that says how this is done.
As I recall there was a way to do this with wxMaxima, so maybe I just haven't found the trick in Sage yet.
jdpipeFri, 23 Mar 2012 08:11:38 -0500http://ask.sagemath.org/question/8822/Solve failshttp://ask.sagemath.org/question/48390/solve-fails/I wonder why the Variable 'x_0' not found
gr=Polyhedron(ieqs=[(10,-1,0),(-12,0,1)])
p1=gr.plot()
x_0, x_1 = var('x_0 x_1')
lin=solve([70==6*x_0+18*x_1],x_1)
p2=plot(lin, (x,8,14))
p1+p2CyrilleThu, 17 Oct 2019 23:50:09 -0500http://ask.sagemath.org/question/48390/how do I enter 2sin|1−3√2|cos|1+ 2√3|http://ask.sagemath.org/question/47722/how-do-i-enter-2sin1-32cos1-23/when I enter it in SageMath as `2 * sin * abs(1-3 * sqrt(2))*cos*abs(1+2 * sqrt(3))` it does not run the code? your help would be very appreciated :)ariaaaaaaaaMon, 02 Sep 2019 10:44:08 -0500http://ask.sagemath.org/question/47722/error for (3*e+2*I)*(-3+pi*I)http://ask.sagemath.org/question/47729/error-for-3e2i-3pii/so, I have to type in the problem (3e+2i)(−3+πi)...I enter in `(3*e+2*I)*(-3+pi*I)` on SageMath but come up with the answer, -30.74772176 + 19.61920267*I....am I dumb or is the correct answer?ariaaaaaaaaMon, 02 Sep 2019 12:07:52 -0500http://ask.sagemath.org/question/47729/how do I enter (3e+2i)(−3+πi)?http://ask.sagemath.org/question/47715/how-do-i-enter-3e2i-3pi/every time I enter I to represent i, it comes as an invalid syntax? pls help :)ariaaaaaaaaSun, 01 Sep 2019 17:10:09 -0500http://ask.sagemath.org/question/47715/how do I enter (3e+2i)(−3+πi)?http://ask.sagemath.org/question/47714/how-do-i-enter-3e2i-3pi/ every time I enter i as I it comes up as an invalid syntax? Pls help ariaaaaaaaaSun, 01 Sep 2019 17:09:14 -0500http://ask.sagemath.org/question/47714/Computing a formula in SAGEhttp://ask.sagemath.org/question/47509/computing-a-formula-in-sage/Fix the positive integer numbers $t_1, t_2, t_3,t_4, t_5.$ We have the following formula:
$$ S= \sum_{i, j, h, m, k_1 + k_2+k_3+k_4 = i-t_1, \ell_1+\ell_2 + \ell_3 = j -t_2 + k_4, u_1 + u_2 = h - t_3+k_3+\ell_3 }M_1.M_2.M_3. M_4,$$
where
$$ M_1 = \binom{t_5-k_1}{k_1}\binom{t_4-k_2}{k_2}\binom{t_3-k_3}{k_3}\binom{t_2-k_4}{k_4}$$
$$ M_2 = \binom{t_5-k_1-\ell_1}{\ell_1}\binom{t_4-k_2-\ell_2}{\ell_2}\binom{t_3-k_3-\ell_3}{\ell_3}$$
$$ M_3 = \binom{t_5-k_1-\ell_1-u_1}{u_1}\binom{t_4-k_2-\ell_2-u_2}{u_2};$$
$$ M_4=\binom{t_1+t_2+t_3+t_4 +t_5-i - j-h-m}{m - t_4 + k_2+ \ell_2 + u_2}.\lambda_i\lambda_j\lambda_h\lambda_m\lambda_{t_1+t_2 + t_3+t_4+t_5 - i - j-h-m}$$
Here, the binomial factors $\binom{n}{k}$ mod 2 and the value of $S$ mod 2. By convention, $\binom{n}{k} \equiv 0$ (mod 2) if either $k < 0$ or $n < 0$ or $k > n.$
I don't how to construct this formula in SAGE. Can someone show me how to compute it using SAGE?VochauMon, 19 Aug 2019 08:27:56 -0500http://ask.sagemath.org/question/47509/Calculating Cauchy Integrals in Sagehttp://ask.sagemath.org/question/47017/calculating-cauchy-integrals-in-sage/Hi!
I am relatively new to complex analysis and I am trying to write down the following integral in Sage Math:
$$
I(k) = \frac{1}{2i\pi}\oint\frac{(1-t^2)}{(1-t)^n}\frac{dt}{t^{k+1}}
$$
from a paper that can be found at:
http://magali.bardet.free.fr/Publis/ltx43BF.pdf
The contour is a unit circle around the origin with a radius less than 1.
whereby $$S(n) = \frac{(1-t^2)}{(1-t)^n} $$ is a formal power series. The Cauchy Integral will produce the k-th coefficient of $S(n)$. I tried doing the following:
<!-- language: python -->
def deg_reg_Cauchy(k, n, m):
R.<t> = PowerSeriesRing(CC, 't')
constant_term = 1/(2*I*pi)
s = (1-t**2)**m / (t**(k+1)*(1-t)**n)
s1 = constant_term * s.integral()
return s1
I realize this is probably ***very*** wrong and I used $0$ till $2\pi$ as simple placeholders until I find appropriate values. Does anyone have any tips on how to go about this, please? Below is the error message that is being outputted by Sage.
<!-- language: python -->
ArithmeticError: The integral of is not a Laurent series, since t^-1 has nonzero coefficient.
Thank you!JoaoDDuarteSat, 29 Jun 2019 12:01:11 -0500http://ask.sagemath.org/question/47017/2D Points, best paractive to store Pointshttp://ask.sagemath.org/question/45444/2d-points-best-paractive-to-store-points/
sage: from sage.plot.point import Point
sage: P = Point([1,2],[2,3],{'alpha':.5})
sage: P
Point set defined by 2 point(s)
sage: P.options()['alpha']
0.500000000000000
sage: P.xdata
[1, 2]
Why is this not working:
sage: P = Point([1,2],[2,3])
Why do I need this alpha Parameter?
thethaWed, 13 Feb 2019 04:33:40 -0600http://ask.sagemath.org/question/45444/Importing Sage functions into Cython?http://ask.sagemath.org/question/42277/importing-sage-functions-into-cython/ I am trying to define variables in Cython part of my code like this
a,b,c = var('a,b,c')
But in this line I cant import var() function from Sage
from sage.calculus.var import var
I got this error:
$ sage -python real_sage.sage
Compiling ./real_sage.spyx...
Traceback (most recent call last):
File "real_sage.sage", line 6, in <module>
from real_sage import foo
File "real_sage.pyx", line 10, in init real_sage
File "sage/calculus/var.pyx", line 6, in init sage.calculus.var
File "/home/tunamustafakemal/sega/SageMath/local/lib/python2.7/site-packages/sage/symbolic/function_factory.py", line 15, in <module>
from sage.symbolic.function import SymbolicFunction, sfunctions_funcs, \
File "sage/rings/integer.pxd", line 7, in init sage.symbolic.function
File "sage/rings/rational.pxd", line 8, in init sage.rings.integer
File "sage/rings/rational.pyx", line 89, in init sage.rings.rational
File "sage/rings/real_mpfr.pyx", line 1, in init sage.rings.real_mpfr
File "sage/rings/complex_number.pxd", line 6, in init sage.libs.mpmath.utils
File "sage/rings/complex_double.pxd", line 10, in init sage.rings.complex_number
File "sage/rings/complex_double.pyx", line 94, in init sage.rings.complex_double
ImportError: cannot import name complex_number
Thanks for any support.tunaSun, 06 May 2018 23:14:53 -0500http://ask.sagemath.org/question/42277/Is matrix calculus possible within sagemath?http://ask.sagemath.org/question/32414/is-matrix-calculus-possible-within-sagemath/For example, is it possible to compute the following partial derivative in Sagemath:
$$
A_{ij} = \frac{\partial e_{ij}(x)}{\partial x_i} = \begin{pmatrix}
-R_{ij}^T R_i^T & R_{ij}^T \frac{\partial R_i^T}{\partial \theta_i} (t_j - t_i) \\\
0^T & -1
\end{pmatrix}
$$
for
$$
e_{ij}(x) = \begin{pmatrix}
R_{ij}^T (R_i^T (t_j - t_i) - t_{ij}) \\\
\theta_j - \theta_i - \theta_{ij}
\end{pmatrix}
$$
and
$$
x_i^T = (t_i^T, \theta_i)
$$
$$
z_{ij}^T = (t_{ij}^T, \theta_{ij})
$$
The background shouldn't be important, but just for completeness: this example is an excerpt from Robotics, especially the problem of Pose Graph Simultaneous Mapping and Localization. $x_i$ defines a pose in $\mathbb{R}^2$ with translation $t_i$ and rotation angle $\theta_i$, $z_{ij}$ defines a transform between two poses and $e_{ij}(x)$ defines the error between two poses, i.e. a transform between them.
morphTue, 02 Feb 2016 03:20:41 -0600http://ask.sagemath.org/question/32414/help on using chain rule in Sagehttp://ask.sagemath.org/question/36673/help-on-using-chain-rule-in-sage/Does anyone have any tips for using Sage to take derivatives of functions of many variables?
For example, if I define
```w(x,y) = x^2 + y^2``` (say)
and then if I suppose that ```x``` and ```y``` depend on an independent variable ```t```, the chain rule applies for finding ```w.diff(t)```. The only way I found to do this in Sage is
```var('t')```
```x(t) = cos(t)``` (say)
```y(t) = sin(t)```
```w(x,y) = x^2 + y^2```
```w.diff(t)```
But this isn't really using the chain rule. If I instead try
```var('x,y')```
```(define w again)```
```(define x and y again)```
```w.diff(t)```
```Out: (x,y) |--> 0```
Apparently it thinks the derivative is zero because it still thinks ```x``` and ```y``` are two independent variables where they appear in ```w```, even though you get
```x```
```Out: t |--> cos(t)```
and similarly for ```y```. Any suggestions? Thanks.
lefthandstanderMon, 20 Feb 2017 01:25:01 -0600http://ask.sagemath.org/question/36673/Code error in sagemathhttp://ask.sagemath.org/question/36579/code-error-in-sagemath/ My code in sagemath
def bruteforce
count = 0
s = [0, 1, 2, 4, 8]
s.each do |a|
s.each do |b|
s.each do |c|
s.each do |d|
s.each do |e|
if a+b+c+d+e == 8
count += 1
puts "#{count}.: #{a}+#{b}+#{c}+#{d}+#{e}"
end
end
end
end
end
end
count
end
but it was an error as below
File "<ipython-input-1-87370adfacc9>", line 1
def brutefor
SyntaxError: invalid syntaxdavisSat, 11 Feb 2017 20:08:47 -0600http://ask.sagemath.org/question/36579/Find all non-negative integer solutions of $a+b+c+d+e = 8$ in Sagemathhttp://ask.sagemath.org/question/36564/find-all-non-negative-integer-solutions-of-abcde-8-in-sagemath/Find all non-negative integer a, b, c,d, e such that
$$a+b+c+d+e = 8$$
Is there any method for this? I have no idea. I can just fix the limit.davisSat, 11 Feb 2017 03:30:54 -0600http://ask.sagemath.org/question/36564/solution to homogeneous system of linear equations with coefficients over field $\mathbb{F}_2$http://ask.sagemath.org/question/36580/solution-to-homogeneous-system-of-linear-equations-with-coefficients-over-field-mathbbf_2/Solve the following homogeneous systems of linear equations with coefficients over field $\mathbb{F}_2$:
x1+x2+x3+x4+x5+x6+x7 = 0
x1=0
x2+x3+x4 =0
x5=0
I want to output on the sage following:
x1=x5=0
x6=x7
x2+x3+x4=0
I want to solve a general homogeneous systems with coefficients over field $\mathbb{F}_2$ and output same as above.
I hope that someone can help. Thanks!davisSat, 11 Feb 2017 20:31:11 -0600http://ask.sagemath.org/question/36580/Construction of formula in Sagemath programhttp://ask.sagemath.org/question/36533/construction-of-formula-in-sagemath-program/Let $P_k:= \mathbb{F}_2[x_1,x_2,\ldots ,x_k]$ be the polynomial algebra in $k$ variables with the degree of each $x_i$ being $1,$ regarded as a module over the mod-$2$ Steenrod algebra $\mathcal{A}.$ Here $\mathcal{A} = \langle Sq^{2^m}\,\,|\,\,m\geq 0\rangle.$
Being the cohomology of a space, $P_k$ is a module over the mod-2 Steenrod algebra $\mathscr{A}.$ The action of $\mathscr{A}$ on $P_k$ is explicitly given by the formula
$$Sq^m(x_j^d) = \binom{d}{m}x_j^{m+d},$$
where $ \binom{d}{m}$ is reduced mod-2 and $\binom{d}{m} = 0$ if $m > d.$
Now, I want to use the Steenrod algebra package and Multi Polynomial ring package and using formular above to construction of formula following in Sagemath program
$$
Sq^m(f) = \sum\limits_{2^{m_1} + 2^{m_2} + \cdots + 2^{m_k}= m}\binom{d_1}{2^{m_1}}x_1^{2^{m_1}+d_1}\binom{d_1}{2^{m_2}}x_2^{2^{m_2}+d_2}\ldots \binom{d_k}{2^{m_k}}x_k^{2^{m_k}+d_k}.$$
forall $f = x_1^{d_1}x_2^{d_2}\ldots x_k^{d_k}\in P_k$
Example: Let $k = 5, m = 2$ and $f = x_1^2x_2^3x_3^2x_4x_5\in P_5.$ We have
$$
Sq^2(x_1^2x_2^3x_3^2x_4x_5) = x_1^4x_2^3x_3^2x_4x_5 + x_1^2x_2^5x_3^2x_4x_5 + x_1^2x_2^3x_3^4x_4x_5
+x_1^2x_2^3x_3^2x_4^2x_5^2 + x_1^2x_2^4x_3^2x_4x_5^2 + x_1^2x_2^4x_3^2x_4^2x_5^1.$$
I hope that someone can help. Thanks!davisFri, 10 Feb 2017 00:29:40 -0600http://ask.sagemath.org/question/36533/Integration and differentiation symbolshttp://ask.sagemath.org/question/36441/integration-and-differentiation-symbols/I have seen this in the examples but it doesn't appear to be very easy unless I am totally missing something. It is important that the proper symbology be used in presentation form to show the integration symbol and or differentiation symbol. But can't seem to find any way of doing it . This should be straight forward like show(integral()) and it puts the integral symbol on the screen especially in showing symbolic calculations.
How do you get the symbols on the screen? NT4MAXIMUSDThu, 02 Feb 2017 07:15:53 -0600http://ask.sagemath.org/question/36441/Coordinate Transformshttp://ask.sagemath.org/question/9966/coordinate-transforms/Is there something in sage that does the same thing that `CoordinateTransform` and `TransformedField` in Mathematica 9 ?
The idea is that `CoordinateTransform` is given some coordinates, e.g. (r,th) and asked to transform them from "polar" to "cartesian", thus gives the expression of the cartesian coordinates in terms of the polar coordinates, e.g.
(x(r,th), y(r,th)) = (r*cos(th), r*sin(th))
Obvioulsly, it also works with other coordinates systems.
`TransformedField` makes the transformation between a scalar, vector, or tensor field in, say, cartesian coordinates, to spherical coordinates.
These actions are not very complicated, nor difficult to implement when needed, but they are also very common.
Thanks.
references :
* http://reference.wolfram.com/mathematica/ref/CoordinateTransform.html
* http://reference.wolfram.com/mathematica/ref/TransformedField.htmlConvenient TruthSun, 31 Mar 2013 13:04:28 -0500http://ask.sagemath.org/question/9966/A simple problem related to symbolic calculationhttp://ask.sagemath.org/question/26982/a-simple-problem-related-to-symbolic-calculation/Could anyone let me know how you can define a variable as some function of another variable without specific definition? For example, how can you define theta as some function of x and then differentiate the 'sin(theta)' by x?
The following is my code that doesn't work. I couldn't find how to fix it in reference manuals. Any help will be appreciated.
var('theta, y, f')
y=sin(theta) ; theta=f(x);
y.derivative(x)Nownuri1Sat, 30 May 2015 07:15:05 -0500http://ask.sagemath.org/question/26982/A symbolic convolution of arbitrary functionshttp://ask.sagemath.org/question/8507/a-symbolic-convolution-of-arbitrary-functions/In [this manual](http://www.sagemath.org/doc/constructions/calculus.html#convolution) it is described how to get a symbolic result of "the convolution of any piecewise defined function with another". However, when I try this with functions like exponent, this does not work:
x = PolynomialRing(QQ, 'x').gen()
f = Piecewise([[(0,1),exp(x)]])
f.convolution(f)
I get an error "RuntimeError: Symbolic Ring still using old coercion framework"
If I use a 'RR' ring instead of 'QQ', Piecewise() returns another error "TypeError: cannot coerce arguments: __call__() takes exactly 1 positional argument (0 given)"
I have 2 questions:
1. Is there a way to get a function, which represent convolution of a gaussian function and a decaying exponent (and, generally, any functions)? I want to fit my data with such a function.
2. How to get a symbolical convolution of functions with parameters (they should be assumed to be constants during convolution computation)?ADuC812Wed, 23 Nov 2011 17:01:36 -0600http://ask.sagemath.org/question/8507/cannot calculate limithttp://ask.sagemath.org/question/25647/cannot-calculate-limit/No answer from Sage-6.4.1 for this limit :
var('n');
u = (1+sqrt(n))^(-n);
limit(u(n=n+1)/u,n=infinity)
Sage 4.7 gives 0 (correct). Why ?marguinFri, 30 Jan 2015 04:20:28 -0600http://ask.sagemath.org/question/25647/computing integralhttp://ask.sagemath.org/question/24395/computing-integral/ Hello, I would like to compute for example this double integral:
exp(i*x*cos(y))
0 < x < pi
0 < y < 2
Could you please advice how to do that?
Thank you very much for your answer.
MartinMartin MaxaSat, 04 Oct 2014 09:15:30 -0500http://ask.sagemath.org/question/24395/derivatives of variable orderhttp://ask.sagemath.org/question/24045/derivatives-of-variable-order/ Using `diff/derivative` it does not seem easily possible to specify derivatives of variable order, e.g., to define a function `P(m,n)` that applies the `diff` `m+n` times to a polynomial:
sage: x=var('x')
sage: P(m,n)=derivative((1-x^2)^n,x,m+n)
...
TypeError: argument symb must be a symbol
sage: R.<x> = PolynomialRing(QQ, 'x')
sage: p=(1-x^2)^11
sage: P(m,n)=derivative(p,x,m+n)
...
ValueError: Cannot differentiate with respect to m + n
This is obviously because `diff` supports such syntactic sugar like `diff(p,x,x,x)`. So how to differentiate to a variable order?
rwsMon, 08 Sep 2014 04:12:11 -0500http://ask.sagemath.org/question/24045/Why is diff(conjugate(x),x) unevaluated?http://ask.sagemath.org/question/24027/why-is-diffconjugatexx-unevaluated/Or, can we differentiate holomorphic functions only?
Wirtinger defined two derivations in complex analysis for which we have:
diff(x,conjugate(x)) = 0
and
diff(conjugate(x),x) = 0.
http://en.wikipedia.org/wiki/Wirtinger_derivatives
Wirtinger calculus has important applications in optimization and has been extended to quaternion functions.
Is there any situation in which leaving diff(conjugate(x),x) unevaluated is an advantage?Bill Page _ againTue, 02 Sep 2014 20:25:09 -0500http://ask.sagemath.org/question/24027/Sinc functionhttp://ask.sagemath.org/question/23761/sinc-function/I am trying to perform some calculus involving the function $f(x) = \sin(x)/x$ in Sage. This function has a removable sigularity at the origin. Is there a way that I can "modify" the function in Sage to set $f(0) = 1$ while preserving the ability to do things like symbolically differentiate it?ajdWed, 13 Aug 2014 12:57:09 -0500http://ask.sagemath.org/question/23761/how to get the Values from an expressionhttp://ask.sagemath.org/question/11013/how-to-get-the-values-from-an-expression/ #Sum of n-th roots of unity is zero.
n=10;
for i in range(1,n):
v=solve(x^i - 1,x);
sum_roots = 0;
m=i;
for j in range(0,i):
sum_roots += v[j]; # error here .. I want the values, not the expression
print ' sum of n-th roots of ' ;
print m;
print ' is ';
print sum_roots ;
How do i get the values from the list of expressions returned by solve?
I have another Question-: How can I see all the member functions of any type,say expression..I have tried putting ? sfter the command, but that does not give all the member functions.
srikanth sskSat, 08 Feb 2014 23:10:18 -0600http://ask.sagemath.org/question/11013/