Ask Your Question

ali's profile - activity

2020-08-04 22:58:53 +0200 received badge  Popular Question (source)
2018-08-13 19:13:13 +0200 received badge  Good Question (source)
2018-08-11 09:05:03 +0200 received badge  Scholar (source)
2018-08-09 14:17:29 +0200 commented answer arrange an expression in powers of a variable

Thanks! How to access the coefficients of each power? If you noticed, I am trying to use Sage for asymptotic analysis of DE's. Is there any guide/doc for this topic?

2018-08-09 14:08:34 +0200 received badge  Supporter (source)
2018-08-08 19:38:44 +0200 received badge  Nice Question (source)
2018-08-08 10:48:58 +0200 received badge  Student (source)
2018-08-08 10:33:57 +0200 asked a question 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.