Ask Your Question

Lucas_Malor's profile - activity

2018-05-09 18:05:46 -0500 received badge  Taxonomist
2016-07-09 22:23:10 -0500 received badge  Famous Question (source)
2014-07-25 04:24:49 -0500 received badge  Notable Question (source)
2013-11-01 02:14:14 -0500 received badge  Popular Question (source)
2012-08-03 17:21:22 -0500 received badge  Student (source)
2012-07-15 08:07:50 -0500 received badge  Editor (source)
2012-07-15 06:48:41 -0500 asked a question Order of a differential equation?

Does it exists a method or a function that returns the the order of a (O-P)DE?

2012-07-15 00:31:18 -0500 commented answer How to extract coefficient terms from a differential equation, as for polynomial?

I'll see if this is a bug, thank you :)

2012-07-15 00:30:32 -0500 received badge  Scholar (source)
2012-07-15 00:30:32 -0500 marked best answer How to extract coefficient terms from a differential equation, as for polynomial?

You can use DE.coeff(u,2) to extract the coefficient of $u^2$.

You can see a list of commands you can use with your expression DE by typing DE. and hitting the tab key.

2012-07-14 07:14:35 -0500 received badge  Supporter (source)
2012-07-14 07:13:59 -0500 commented answer How to extract coefficient terms from a differential equation, as for polynomial?

Mmmh... it really works with the simple example above, but not in the more complicated (and bad) code I was working on: var('x, u, u1, u2) f = -3*u2*(u1/u + 1/x) - 3*(u1)^2/(x*u) eta = function('eta', x, u, u1) def D(f, g) : return f.diff(x) + u1*f.diff(u) + u2*f.diff(u1) + g*f.diff(u2) D1_eta = D(eta, f) D2_eta = D(D1_eta, f) D3_eta = D(D2_eta, f) DE = D3_eta - f.diff(u)*eta - f.diff(u1)*D1_eta - f.diff(u2)*D2_eta DE.coeff(u2,3) I must do DE.collect(u2).coeff(u2,3) Furthemore if you print DE.collect(u2) terms are expanded, but not collected with respect to u2. I must do DE.collect(u2).collect(u2) It's really strange... it's a bug or my fault? I have Sage 5.1 running on Ubuntu 12.04 ... (more)

2012-07-14 01:59:09 -0500 asked a question How to extract coefficient terms from a differential equation, as for polynomial?

Hello all. As title, I want to extract from a differential equation the term coefficients with respect to a variable. For example:

var('x, u')
y = function('y', x)
DE = y.diff(x)*u^2 + 2*u + x

from DE I want to create a new symbolic expression with the coefficient of u^2, in this case y.diff(x). Must I convert DE to a polynomial ring? And how can I do it?