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.Wed, 02 Dec 2020 01:44:06 +0100Computing power series local coordinates on an algebraic curvehttps://ask.sagemath.org/question/54184/computing-power-series-local-coordinates-on-an-algebraic-curve/Let's say I have an elliptic curve $E$ given by a Weierstrass equation in $x$ and $y$. Let's say I choose a uniformizer $t$ around a point $P$ on $E$.
Then is there a SAGE function that writes $x$ or $y$ as a power series in $t$ in a neighborhood of $P$?
Often, I might take something like $t=x$, so it's a matter of writing $y$.
Even more to the point, I want to take a differential form regular at $P$, say in the form $dx/y$ or $xdx/y$, and write it as a power series times $dt$?
More generally, for any smooth point on a curve, or even any smooth point on a scheme and a system of parameters at that point, there should be a function that takes a regular function in a neighborhood of that point and writes it as a power series in those parameters. I could imagine writing something like this myself, but it would take a lot of work, and I would hope this is already implemented.davidac897Tue, 10 Nov 2020 04:51:17 +0100https://ask.sagemath.org/question/54184/What's the easiest way to calculate a Hironaka standard basis using SageMath?https://ask.sagemath.org/question/54506/whats-the-easiest-way-to-calculate-a-hironaka-standard-basis-using-sagemath/Hi, everyone!
I'm trying to do some computations with (truncated) multivariable power series, which I'd like to put into Hironaka standard basis form. This is almost the same as a Groebner basis, except that the "leading" terms have smallest degree instead of largest. This requires slight changes to the algorithms in order to make sure they terminate. Does anyone know if this has been implemented in Sage or have a good way to fake it? I don't use Sage a lot and I can't find anything obvious in the documentation so I thought I'd ask before trying to re-implement something.
Thanks very much!
----Josh
joshuarbholdenWed, 02 Dec 2020 01:44:06 +0100https://ask.sagemath.org/question/54506/Puiseux series expansionhttps://ask.sagemath.org/question/32861/puiseux-series-expansion/Is there a function for a [Puiseux series](https://en.wikipedia.org/wiki/Puiseux_series) expansion? I found a posting ([here](https://groups.google.com/forum/#!topic/sage-devel/M0XDXGH_oXI)) that is from 2011, but it seems that the code has not found its way into the distribution. Can someone confirm this or please point me to the right function? Thanks!wrognWed, 23 Mar 2016 11:50:12 +0100https://ask.sagemath.org/question/32861/Calculating Cauchy Integrals in Sagehttps://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 19:01:11 +0200https://ask.sagemath.org/question/47017/Symbolic sum/product of Laurent/power serieshttps://ask.sagemath.org/question/46367/symbolic-sumproduct-of-laurentpower-series/ How can I do something like this?
#f = some Laurent/power series in x e.g.
#a,b,w are symbolic such that e.g. 2*w**2 = 3
f = 1/x + w + a*x + b*x**2 + ((a+b)/w)**2*x**3 + O(x**7)
#g[i] = some power series in x derived from f, c[i], d[i], e.g.
g[i] = (x*f + c[i])/(d[i]*f + x**2)
#product of n first g[i]
#n is symbolic
G = product(g[i], i=1..n)
#extract coefficients of x in G
G.coeff(x,-1), G.coeff(x,0), G.coeff(x,1)
Thank you.RoadFri, 26 Apr 2019 19:44:06 +0200https://ask.sagemath.org/question/46367/Coefficients of inversed polynomialhttps://ask.sagemath.org/question/46080/coefficients-of-inversed-polynomial/I want to lazily compute coefficients of inversed integer based polynomial.
For example, I have: $$ P = 1 - x $$ and I want to get formal power series of it's inverse:
$$ \frac{1}{P} = \frac{1}{1-x} = 1 + x + x^2 + \dots $$
But actually, I would like to get the n-th coefficient of it.
How can I do it?
P.S: I tried the following code, but it computes only 20 coefficients:
sage:> F.<x> = PowerSeriesRing(ZZ); F
sage:> F([1])/(1-x)
1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^10 + x^11 + x^12 + x^13 + x^14 + x^15 + x^16 + x^17 + x^18 + x^19 + O(x^20)
I think I can change precision every time I want to get a coefficient bigger than default 20, but it requires recomputing of that power series, so I want to know is there another way.PaulRaWed, 10 Apr 2019 22:28:16 +0200https://ask.sagemath.org/question/46080/arrange an expression in powers of a variablehttps://ask.sagemath.org/question/43282/arrange-an-expression-in-powers-of-a-variable/I have the following code:
f0 = function('f0')(x)
f1 = function('f1')(x)
var('ep')
y = f0+ep*f1
de=ep*diff(y,x,2)+diff(y,x)
expand(de)
which gives the output:
ep^2*diff(f1(x), x, x) + ep*diff(f0(x), x, x) + ep*diff(f1(x), x) + diff(f0(x), x)
How can I rearrange this expression in powers of "ep" parameter? i.e
ep^2*diff(f1(x), x, x) + ep*( diff(f0(x), x, x) + diff(f1(x), x) ) + diff(f0(x), x)
Then I want to get the coefficient for each power (which is a differential eq) and then pass it to the desolve.aliWed, 08 Aug 2018 10:20:08 +0200https://ask.sagemath.org/question/43282/square root of a polynomial with variable coefficientshttps://ask.sagemath.org/question/39978/square-root-of-a-polynomial-with-variable-coefficients/I want to calculate the square root of a polynomial with variable coefficients in sage. For example:
i,z=var('i,z')
c=function('c')
p=sum(c(i)*z^i,i,0,6)
sqrt(p)
returns
sqrt(z^6*c(6) + z^5*c(5) + z^4*c(4) + z^3*c(3) + z^2*c(2) + z*c(1) + c(0))
I want a Taylor or Laurent expansion in z. How do I get this?
charleslebarronWed, 06 Dec 2017 20:10:06 +0100https://ask.sagemath.org/question/39978/How convert a polynomial in a power series?https://ask.sagemath.org/question/36129/how-convert-a-polynomial-in-a-power-series/Consider the following situation:
R.<x> = PowerSeriesRing(ZZ)
f = x^2 - x + 1
print f, f.parent()
g = cyclotomic_polynomial(6)
print g, g.parent()
which gives
1 - x + x^2 Power Series Ring in x over Integer Ring
x^2 - x + 1 Univariate Polynomial Ring in x over Integer Ring
Question: How can I convert a polynomial in a power series?
In the example above I would like to input a cyclotomic polynomial and
get as output it's inverse when interpreted as a power series.
cyclotomic_polynomial(6).as_ps().inverse().list()
[1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1]
In the pseudo code above "as_ps()" indicates the missing link.
Peter LuschnySat, 31 Dec 2016 11:43:04 +0100https://ask.sagemath.org/question/36129/Pade approximationhttps://ask.sagemath.org/question/32722/pade-approximation/ How to use the pade function to calculate the pade approximation of a function.
I have a function (for example arctan(x) ) and would like to calculate the pade approximation of that function. I have found that there exists a function for that in sage, but I was not able to run it, could someone help me with that?
vkristijanSat, 05 Mar 2016 19:17:51 +0100https://ask.sagemath.org/question/32722/Want to create a generic series with indexed coeffs, e.g. a[1], a[2],...https://ask.sagemath.org/question/32202/want-to-create-a-generic-series-with-indexed-coeffs-eg-a1-a2/Hello, I'm very new to Sage and would like to take a horrible equation, $H(e^v,z)=0$, and substitute into $v$ a power series, like $v(z)=\sum_{i=l}^{u} a[i] z^i, $ where maybe $l<0$. I'd then like to solve for the coefficients, at each power of $z$, or all at once like Mathematica does (or so I'm told). The Mathematica version is here in case it helps clear up my question.
ord = 10;
eq2 = (-(1 - Exp[v])*Exp[2*(z^2 + Log[-Sqrt[3]] + 2*Log[3]) + 9*v]) -
3^(5/2)*(9*Exp[4*v] - 3*Exp[3*v] - 4*Exp[2*v] - Exp[v] + 1)*
Exp[z^2 + 3*v] - 3*Exp[v] + 1
VV = Series[Sum[a[i] z^i, {i, 0, $ord}], {z, 0, $ord}]
a[0] = (-1/2)*Log[3]
ef2 = Block[{$MaxExtraPrecision=1000},Solve[Series[(eq2 /. v -> VV), {z, 0, $ord}] == 0,
Table[a[i], {i, 1, $ord}]]//FullSimplify]
VV/.ef2
Everything is complex and I was thinking of something like this pseudo-script:
M.<v,z> = AsymptoticRing(growth_group='exp(v^CC)*exp(z^CC)*CC',coefficient_ring=CC); M
t = M.gens()
f = sum(t[n]*z^n for n in range(8))
eq = e^(4*v+3*z)+...;
eq.substitute(v=f)
eqZ1 = eq.solve(z)
eqZ2 = eq.solve
But this is very scattered, rough, and not even meaningful. I'm not sure if using this 'experimental' AsymptoticRing is a good idea, nor if my growth group is correct. I also see things like .substitute, etc. from the /ref/Calculus.
All I really want to do is take a generic expression $$H = \sum_i e^{a_i*v + b_i*z^2}=0,$$ where $a_i$ and $b_i$ are complex, and replace the $v$ with $\sum_{i=low}^{i=high} h_i z^i$ -- actually I am working on 'eq2', of several, in the first Mathematica block. Then take Taylor series and solve for the coefficients $a_i$ in ascending powers of $z$. This is much like Hinch's book, Perturbation Methods, in the very beginning, for "expansion methods".
Thank you for your time and help!brettFri, 15 Jan 2016 02:00:24 +0100https://ask.sagemath.org/question/32202/