Ask Your Question

Marios Papachristou's profile - activity

2018-06-03 13:19:35 -0500 received badge  Notable Question (source)
2017-12-14 09:20:18 -0500 received badge  Popular Question (source)
2016-11-28 05:51:02 -0500 received badge  Famous Question (source)
2016-03-23 01:42:09 -0500 received badge  Notable Question (source)
2016-03-23 01:42:09 -0500 received badge  Popular Question (source)
2015-02-03 13:20:02 -0500 commented question Solving PDEs

Thank you very much! I would like to wonder if there is extensive documentation on PDEs with sage (even with hundreds of lines of code). I am particularly interested in solving time dependent Schroedinger Equations that in one dimension (for example) have the form $$\hat H \psi = i\hbar \dot \psi$$ meaning that the wavefunction depends on x (space) and t (time). However in simpler forms (where for example the potential energy is 0) then the solution can be expressed as a product of two functions (like in the heat equation) as $\psi = \psi (x,t) = X(x)T(t)$

UPDATE: This method works pretty for such equations well since the equations reduce to $\hat H X = EX$ and $\dot T = E/(i \hbar ) T$ and the algorithm is very simple.

2015-02-03 13:04:47 -0500 received badge  Scholar (source)
2015-02-03 13:04:45 -0500 received badge  Supporter (source)
2015-02-02 10:36:18 -0500 asked a question Solving PDEs

Hello can I solve equations of the following form in sage?

E.g. $$A\frac{\partial ^ n f}{\partial x^n} + B \frac{\partial^kf}{\partial y^k} = 0, \quad f=f(x,y) $$

Meaning a PDE that contains the n-th derivative with respect to x and the k-th derivative with respect to y.

2015-01-01 23:14:06 -0500 received badge  Student (source)
2015-01-01 14:26:59 -0500 asked a question Defining constants after solving ODE/PDE


Solving the differential equation $f'(x) = f(x)$ the answer leads to $f(x) = ce^x$ where $c$ is a constant. How can I generically solve this ODE in SAGE and define $c$ afterwards (I don't want to use ics)?

Consider this script

x = var('x')
f = function('f',x)
f = desolve(diff(f,x) == f(x), f, ival=x)
print str(f(x))
>> ce^x
#I want to define c afterwards

A method I found:

#continue the previous prompt
f(x,c) = f(x)
h(x) = f(x,10)

Is there something else that I can do?

2015-01-01 14:16:51 -0500 commented answer Defining differential operator that acts like curl
  1. However $\nabla \cdot \vec F$ work in n-dimensions since it's a dot product
  2. I do not want to just calculate the derivative but I want the differential operator to act as a multiplier

For example the hamiltonian operator $\hat H = \frac {\hbar}{-2m} \nabla^2 + V $ can act on a wavefunction $\psi$ as $$\hat H | \psi \rangle = - \frac{\hbar}{2m} \nabla^2 \psi + V \psi$$

2014-12-30 08:19:04 -0500 received badge  Editor (source)
2014-12-30 07:45:21 -0500 asked a question Defining differential operator that acts like curl


As a newbie in using SAGE (experience with Python and Numpy), I was wondering how to define a differential operator that acts like curl (or $\nabla \times \vec F$). The curl for a vector field $\vec F=(F_x,F_y, F_z)$is defined as a determinant $\mathrm{det} (\nabla,\vec F) $. I want to define such operators that act on $F_x, F_y, F_z$ without calculating the determinant a priori. In other words if I was to multiply $\frac {\partial }{\partial x}$ with $F_y$, I would expect to get $\frac{\partial F_y}{\partial x}$ EDIT:

class DiffOpp(SageObject):

    def __init__(self, dep_var):
        self.dep_var = dep_var

    def __mul__(self, f):
        return diff(f, self.dep_var)