Ask Your Question

gundamlh's profile - activity

2019-04-18 16:08:01 -0500 marked best answer lcm and gcd of polynomials over the irrationals

Dear all,

I want to calculate the least common multiple of a list of polynomials with coefficients defined over RR or RDF in SAGE. Is it possible?

sage: R.<s> = PolynomialRing(RDF); R
Univariate Polynomial Ring in s over Real Double Field
sage: H = matrix(1,2, [(s+5)**2, s]); H
[s^2 + 10.0*s + 25.0                   s]
sage: lcm(H[0,0], H[0,1])
TypeError: Singular error:
   ? not implemented
   ? error occurred in or before poly.lib::lcm line 852: `           q=gcd(p,i[k]);`
   ? leaving poly.lib::lcm
   skipping text from `;` error at token `)`

Thanks in advance!

2019-04-18 12:55:24 -0500 received badge  Famous Question (source)
2019-01-31 16:08:44 -0500 received badge  Famous Question (source)
2019-01-27 09:21:15 -0500 received badge  Famous Question (source)
2018-06-20 12:01:26 -0500 received badge  Notable Question (source)
2018-06-20 12:01:26 -0500 received badge  Famous Question (source)
2018-06-20 12:01:26 -0500 received badge  Popular Question (source)
2018-03-30 09:51:23 -0500 received badge  Notable Question (source)
2018-03-14 03:53:19 -0500 marked best answer Polynomial coefficient vector to symbolic polynomial

link text

matlab: poly2sym([1 3 2])
ans =
x^2 + 3*x + 2

I couldn't find a similar function in SAGE. Fortunately this small function is quite easy, consisting of only one loop.

Thanks in advance!

2018-01-30 13:41:25 -0500 received badge  Notable Question (source)
2017-10-07 05:37:45 -0500 received badge  Popular Question (source)
2017-05-25 06:39:28 -0500 received badge  Famous Question (source)
2017-05-14 19:45:26 -0500 received badge  Notable Question (source)
2017-04-21 08:06:13 -0500 received badge  Popular Question (source)
2017-04-15 03:41:19 -0500 received badge  Popular Question (source)
2017-04-08 20:33:30 -0500 received badge  Famous Question (source)
2017-03-29 02:37:16 -0500 received badge  Notable Question (source)
2017-01-24 07:58:55 -0500 received badge  Famous Question (source)
2017-01-02 14:14:14 -0500 received badge  Notable Question (source)
2016-12-28 21:53:02 -0500 received badge  Popular Question (source)
2016-08-28 13:30:33 -0500 marked best answer Smith-McMillan Form of a polynomial matrix
sage: s = var('s')
sage: G = matrix([[1,-1],[s^2+s-4,2*s^2-s-8],[s^2-4, 2*s^2-8]])

G is a symbolic matrix, each entry of which is a polynomial of variable s.

How can we calculate the Smith McMillan Form of the matrix G?

NOTE: G.smith_form() doesn't work.

Thanks in advance!

2016-08-28 13:29:33 -0500 received badge  Notable Question (source)
2016-08-28 13:29:33 -0500 received badge  Popular Question (source)
2016-08-27 16:36:24 -0500 received badge  Famous Question (source)
2016-07-31 14:58:11 -0500 received badge  Popular Question (source)
2016-06-29 02:23:41 -0500 received badge  Popular Question (source)
2016-06-29 02:23:41 -0500 received badge  Notable Question (source)
2016-06-29 02:23:41 -0500 received badge  Famous Question (source)
2016-06-06 01:12:25 -0500 received badge  Popular Question (source)
2016-05-19 07:58:42 -0500 received badge  Famous Question (source)
2016-04-27 10:10:06 -0500 received badge  Notable Question (source)
2016-04-19 15:32:53 -0500 received badge  Notable Question (source)
2016-03-24 21:15:55 -0500 received badge  Popular Question (source)
2016-03-24 21:15:55 -0500 received badge  Notable Question (source)
2016-03-21 08:04:42 -0500 received badge  Famous Question (source)
2016-03-21 08:04:42 -0500 received badge  Popular Question (source)
2016-03-21 08:04:42 -0500 received badge  Notable Question (source)
2016-03-12 18:41:56 -0500 received badge  Notable Question (source)
2016-02-23 03:31:02 -0500 received badge  Popular Question (source)
2016-02-23 03:31:02 -0500 received badge  Notable Question (source)
2016-01-20 06:30:09 -0500 received badge  Popular Question (source)
2015-11-09 14:41:22 -0500 received badge  Popular Question (source)
2015-11-09 14:40:19 -0500 received badge  Popular Question (source)
2015-10-15 12:10:32 -0500 received badge  Popular Question (source)
2015-03-26 22:12:31 -0500 marked best answer plot grids in a figure

Dear all,

I want to plot grids in my plot.

I couldn't find any keyword like 'grid' in the help document of 'plot()' <function sage.plot.plot.plot="">, and hence I tried NUMERICAL PLOTTING:

sage: from pylab import *
sage: t = arange(0.0, 2.0, 0.01)
sage: s = sin(2*pi*t)
sage: P = plot(t, s, linewidth=1.0)
sage: xl = xlabel('time (s)')
sage: yl = ylabel('voltage (mV)')
sage: t = title('About as simple as it gets, folks')
sage: grid(True)
sage: savefig(os.path.join(SAGE_TMP, 'sage.png'))
sage: P 
[<matplotlib.lines.Line2D at 0x7e0a050>] # stored in RAM?

but nothing came out... OK, how can I check if SAGE can call Matplotlib in my OS (openSuSE 12.3) correctly? I have installed and updated 'matplotlib' for Python 2.7 via YaST2.

Thanks in advance!

2015-03-26 22:12:31 -0500 marked best answer Optimization toolboxes under SAGE

Can we use SAGE to solve some optimization problems? Can we import optimization toolboxes such as YALMIP, MPT, CVX, TOMLAB in SAGE?


Thanks in advance!

2015-03-26 22:12:30 -0500 marked best answer symbolic matrix norm

Matlab has symbolic matrix norm, does Sage also have a command to compute the norm of a symbolic matrix?

Thanks in advance!

2015-03-26 22:12:30 -0500 marked best answer singular value decomposition

I want to use SVD directly in Sage, is it possible?

from http://wiki.sagemath.org/interact/lin..., I know that, we can...

sage: from scipy import linalg

sage: U,s,Vh = linalg.svd(A) # A is a fixed matrix, e.g., A = [1, 2; 3, 4]

Thanks in advance!

2015-03-26 22:12:30 -0500 marked best answer How to create a symbolic arbitrary dimensional zero vector?

one way:

sage: symbolic_expression(list(zero_vector(k))) 
# k, dim. of vector, k is some fixed integer, e.g. k = 10, 
# many thanks to @tmonteil 

but it is too long!!