Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

How do I solve the pde:

$\ -s_x(x,t) -p(x,t)s_t(x,t)=p(x,t)$

for s(x,t) when p(x,t)=2x, subject to the condition s(0,t)=0?

Generally p(x,t) may not be analytical so I would like to use finite differences to transform this into a linear algebra problem:

$\ (-D_x-pD_t)s=p $ But how do I incorporate my "boundary" condition s(0,t)=0 into this?

Thanks in advance for any answers!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

To find the solution you will also need an initial condition like $s(x,0)=\phi(x)$, $x\ge0$. Choose $\Delta x>0$ and $\Delta t>0$, and let $s_{j,k}\approx s(j\,\Delta x,k\,\Delta t)$, $p_{j,k}=p(j\,\Delta x,k\,\Delta t)$ for $j,k\ge0$. The initial condition is then $$s_{j,0}=\phi(j\,\Delta x),\quad j\ge0,$$ and the boundary condition $$s_{0,k}=0,\quad k\ge0.$$

The simplest finite difference approximation is $$ -\frac{s_{j+1,k}-s_{j,k}}{\Delta x}-p_{j,k}\,\frac{s_{j,k+1}-s_{j,k}}{\Delta t}=p_{j,k},\quad j,k\ge0. $$ If $p_{j,k}\ne0$for all $j,k\ge0$, then $$ s_{j,k+1}=\frac{1}{p_{j,k}}\frac{\Delta t}{\Delta x}(s_{j,k}-s_{j+1,k})-\Delta t,\quad j,k\ge0. $$

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.