Ask Your Question

papachristoumarios's profile - activity

2017-12-28 12:06:45 +0100 received badge  Popular Question (source)
2015-09-07 00:32:03 +0100 received badge  Scholar (source)
2015-09-07 00:31:53 +0100 commented answer Problems in solving eigenvalue equations with differential operators

@nbruin Thank you very much!

2015-09-06 10:13:10 +0100 commented answer Problems in solving eigenvalue equations with differential operators

@nbruin. See my simplified example (I have posted it as another answer)

2015-09-06 10:12:30 +0100 received badge  Editor (source)
2015-09-06 10:12:07 +0100 answered a question Problems in solving eigenvalue equations with differential operators

Take for example that $\hat A = a \frac{d^2}{dx^2}, a>0$ which leads to the eigenvalue equation $$\hat A f(x) = b f(x) \iff af''(x) = bf(x)$$ (I assume for simplicity that $b<0$). Using desolve_laplace I define g(x) as the solution to the equation. Then I am not able to substitute the solution to my original equation

Code:

sage: x,a,b = var('x,a,b')
sage: f = function('f',x)
sage: g = function('g',x)
sage: assume(a>0); assume(b<0)
sage: eqn = a*diff(f,x,2) == b*f(x) 
sage: g(x) = desolve_laplace(eqn, f, ivar=x)
sage: g
x |--> (a^2*sin(sqrt(-a*b)*x/a)*D[0](f)(0)/sqrt(-a*b) + a*cos(sqrt(-a*b)*x/a)*f(0))/a
sage: eqn.substitute_function(f,g)
a*D[0, 0](f)(x) == b*f(x)
sage: eqn.substitute_expression(f(x) == g(x))
a*D[0, 0](f)(x) == (a^2*sin(sqrt(-a*b)*x/a)*D[0](f)(0)/sqrt(-a*b) + a*cos(sqrt(-a*b)*x/a)*f(0))*b/a

Am I clear?

2015-09-03 23:50:54 +0100 asked a question Problems in solving eigenvalue equations with differential operators

Let's say we have a linear differential operator $\hat A = \sum_k a_k \frac {d^k} {dx^k}$ and we want to solve the eigenvalue equation $\hat A f(x) = a f(x)$ which is an ODE that we put in sage and outputs a solution $g(x)$. We now want to substitute $f(x)$ with $g(x)$ and simplify our expression in order to extract the eigenvalues of $\hat A$. The problem here is that I am not able to substitute the derivatives with my solution neither via eqn.substitute_expression(f(x) == g(x)) nor via eqn.substitute_function(f(x),g(x)) because D[0]f(x), ... D[0,0,...,0]f(x) remain unchanged.