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.Thu, 25 Oct 2018 20:34:33 -0500Define a modular form from its $q$-expansion coefficientshttp://ask.sagemath.org/question/44072/define-a-modular-form-from-its-q-expansion-coefficients/I have a certain modular form for $\Gamma(N)$ and weight $0$ which I know but just by it's $q$-expansion coefficients, and I want to compute the action of Hecke operators on this modular form. How do I define a modular form object from its q-expansion coefficients, so that I can use it as an input for M.hecke_operator?voaThu, 25 Oct 2018 20:34:33 -0500http://ask.sagemath.org/question/44072/simplify_full() Maxima ECL errorhttp://ask.sagemath.org/question/26004/simplify_full-maxima-ecl-error/Hi all, the following code was working fine in 6.4.1 (I am using the AIIMS ppa in Ubuntu) and now after the 6.5 upgrade, it doesn't work anymore. Assume I have defined all variables.
u(t) = exp(-(t-t_0)^2/(2*sigma^2)) + exp(-(t-t_1)^2/(2*sigma^2)) ; u(t);
u_tilde = integral(u(t)*exp(-I*omega*t), t, -infinity, +infinity, hold=False).simplify_full(); u_tilde;
The problem is in simplify_full(). The erf function and their limits are not evaluated for some reason. I have a hunch this problem has been posted [before](http://ask.sagemath.org/question/25441/calculation-that-is-possible-in-sage-63-is-not-possible-in-sage-64/) but I am not sure. The full traceback is given below. Any help is appreciated.
Thanks
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-8-66e6236c7bf7> in <module>()
----> 1 u_tilde = integral(u(t)*exp(-I*omega*t), t, -infinity, +infinity, hold=False).simplify_full(); u_tilde;
/usr/lib/sagemath/src/sage/symbolic/expression.pyx in sage.symbolic.expression.Expression.simplify_full (build/cythonized/sage/symbolic/expression.cpp:40350)()
8258 """
8259 x = self
-> 8260 x = x.simplify_factorial()
8261 x = x.simplify_rectform()
8262 x = x.simplify_trig()
/usr/lib/sagemath/src/sage/symbolic/expression.pyx in sage.symbolic.expression.Expression.simplify_factorial (build/cythonized/sage/symbolic/expression.cpp:43472)()
8729
8730 """
-> 8731 return self.parent()(self._maxima_().makefact().factcomb().minfactorial())
8732
8733 factorial_simplify = simplify_factorial
/usr/lib/sagemath/src/sage/symbolic/expression.pyx in sage.symbolic.expression.Expression._maxima_ (build/cythonized/sage/symbolic/expression.cpp:5512)()
582 # Maybe not such a great idea because the "default" interface is another one
583 from sage.calculus.calculus import maxima
--> 584 return super(Expression, self)._interface_(maxima)
585 else:
586 return super(Expression, self)._interface_(session)
/usr/lib/sagemath/src/sage/structure/sage_object.pyx in sage.structure.sage_object.SageObject._interface_ (build/cythonized/sage/structure/sage_object.c:5203)()
592 raise NotImplementedError, "coercion of object %s to %s not implemented:\n%s\n%s"%\
593 (repr(self), I)
--> 594 X = I(s)
595 if c:
596 try:
/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc in __call__(self, x, name)
197
198 if isinstance(x, basestring):
--> 199 return cls(self, x, name=name)
200 try:
201 return self._coerce_from_special_method(x)
/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc in __init__(self, parent, value, is_name, name)
624 self._name = parent._create(value, name=name)
625 except (TypeError, RuntimeError, ValueError) as x:
--> 626 raise TypeError(x)
627
628 def _latex_(self):
TypeError: ECL says: Error executing code in Maxima:
Update: I would like to add that the latest version of sage 6.7 still has this problem. Any updates?NahsiNMon, 02 Mar 2015 16:38:48 -0600http://ask.sagemath.org/question/26004/Condition in sum() function?http://ask.sagemath.org/question/24946/condition-in-sum-function/ Hello,
I'm trying to use the exponential form of the Fourier series representation of a function to plot an approximation of said function using the first five terms.
The actual function is f(t) = 1/2 + j/(2*pi) * E from (n = -5) to (n = 5) of ((-1)^n - 1)/n * e^(j*2*n*pi*t), where n =/= 0
Here I'm using 'E' to indicate summation notation. I apologize if this deviates from an established standard, but I'm having trouble uploading images right now (which would have made the function clearer).
The code I'm using for this function is
var('n, t')
j = i # imaginary unit
expr = ((-1)^n - 1)/n * exp(2*pi*n*j*t) # I think the problem is the division by 'n' here
assume(n, 'integer'); assume(n != 0)
f(t) = 1/2 + j/(2*pi) * sum(expr, n, -5, 5)
However, when I try this, I get the following exception:
<code>
RuntimeError: ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative exponent.
</code>
This seems to be due to the division by <code>n</code> in <code>expr</code>. Are my assumptions not working here? Thus, my actual question is how can I add the condition <code>n != 0</code> to the <code>sum()</code> function in sage?mpattonSat, 22 Nov 2014 12:50:08 -0600http://ask.sagemath.org/question/24946/How to solve Fourier transform problem using Sage?http://ask.sagemath.org/question/10948/how-to-solve-fourier-transform-problem-using-sage/Find the Fourier transform of the function
f(x) = { 1, -1 < x < 1
0, |x| > i }
i. Use Fourier series
ii. Use Fourier integral
How can i use Sage to solve this problem?terces907Tue, 21 Jan 2014 04:30:02 -0600http://ask.sagemath.org/question/10948/Find and plot the Fourier transform of the Ricker wavelethttp://ask.sagemath.org/question/24772/find-and-plot-the-fourier-transform-of-the-ricker-wavelet/ 2. The Ricker wavelet, also known as the Mexican hat wavelet, is a popular representation of seismic signals. The Ricker wavelet r(t) is defined as the second derivative of the Gaussian
r(t)=−d2dt2g(t), where g(t)=e−a2t2.
(a) Find and plot the Fourier transform of the Ricker wavelet.
(b) Find the peak frequency: the frequency of the maximum of the Fourier spectrum.
(c) Find the apparent frequency: the frequency corresponding to the period between two minima in the time domain.
fomel_sergeyMon, 03 Nov 2014 22:14:32 -0600http://ask.sagemath.org/question/24772/Illegal kernel in adjoin pvarhttp://ask.sagemath.org/question/9866/illegal-kernel-in-adjoin-pvar/I tried running a seemingly simple script involving a Fourier transform in a sage notebook
var('A, x, delta, k, dx, t, v, xi')
temp = A*exp(-(x/delta)^2)
temp = integral(temp*exp(-I*k*x),(x,-oo,oo)).simplify()
(delta>0).assume()
(k>0).assume()
(dx>0).assume()
(xi<1).assume()
temp = temp*exp(-I*k*t*v)*exp(-(k^2)*t*v*dx*(1-xi)/2)
temp = integral(temp*exp(I*k*x)/(2*pi),(k,-oo,oo))
and I got the following error message
Condition of type: SIMPLE-CONDITION
Illegal kernel in `adjoin-pvar'
Available restarts:
1. (CONTINUE) Return from BREAK.
Top level.
>
Any idea what's going on?bolverkThu, 28 Feb 2013 23:19:14 -0600http://ask.sagemath.org/question/9866/Implementing the basic Fourier-Transformationhttp://ask.sagemath.org/question/9469/implementing-the-basic-fourier-transformation/Hi there!
I'm currently plaing around with sage and I'm really excited about it.
I'd love to do my computations at university and home with a neat opensource-tool instead of the higly prices closed competitors.
Now, the problem I am facing is the symbolif computation of a fourier transformation.
Below is my current naive approach (I'm still learning fourier and complex mathematics, but with large interest!)
x,w,f_0,t = var("x,w,f_0,t")
w = 2*pi*f_0
x(t) = sin(w*t)
integrate(x*exp(-I*w*t),t, -oo, oo)
which results in the following (obviously equal) result:
integrate(e^(-2*I*pi*f_0*t)*sin(2*pi*f_0*t), t, -Infinity, +Infinity)
My expectiation would be an equation without the t (since it has been substituted through integration) and an floating f_0 which I can set according to my desired sine frequency.
Please, could someone tell me, what exactly I am missing here?
Greetings
JakobJakob HolderbaumWed, 24 Oct 2012 23:43:37 -0500http://ask.sagemath.org/question/9469/Recover general formula for fourier series?http://ask.sagemath.org/question/8600/recover-general-formula-for-fourier-series/Hi,
Is there a way to recover the general formula for a fourier series? That is, f.fourier_series_sine_coefficient(9,pi) will give me the 9th sine coefficient, but I'd like to know more generally how I can construct the Nth sine coefficient.
I'm doing some complicated (to me) fourier series, and I'm having trouble figuring out the formula for the Nth.
Thanks for any help.
Andrewgopher13Thu, 29 Dec 2011 08:52:24 -0600http://ask.sagemath.org/question/8600/Low-pass filterhttp://ask.sagemath.org/question/7865/low-pass-filter/ Hello!
Tell me please if it is possible to apply a low-pass filter to the signal using Sage? And if it is possible, what is a way to do it?
I have read that FFT could be used for this, but haven't got the whole idea.
Thanks.v_2eWed, 26 Jan 2011 00:46:34 -0600http://ask.sagemath.org/question/7865/creating a fourier series animationhttp://ask.sagemath.org/question/8062/creating-a-fourier-series-animation/Hello,
I want to create an animation of sum((-1)^(n-1)*sin(n*x)/n,n,1 , k)
and show that as the number of terms 'k' in the partial sums increase, the sum converges to x/2 i.e looks more and more like the graph of x/2.
My first try is
**a = animate([(sum((-1)^(n-1)*sin(n*x)/n,n,1 , k))] for k in range (1,50,1))**
But that returns me an error
*Traceback (click to the left of this block for traceback)
...
AttributeError: 'int' object has no attribute '_maxima_'*
Also I want to include a static graph of x/2 in the background of the animation so that it is easy to observe that the series converges to x/2. how to do this?ebsFri, 08 Apr 2011 22:04:43 -0500http://ask.sagemath.org/question/8062/