I would like to use Matlab's pdepe
to solve this system:
$$ s_t =(sr)_x + s_{ xx } \\ r_t =(\frac{ A }{ B }r^2+s)_x + \frac{ A }{ -K } r_{ xx } $$
where $A$, $B$ and $K$ are constants. I need to solve this using MATLAB pdepe
. The problem is the nonlinear term in my equation: I don't know how to treat the nonlinear part. Boundary and initial conditions are not a problem in that part.
So I've tried to write my PDE in the form that pdepe
expects:
$$\left( \begin{array}{c} 1 \\ 1 \\ \end{array}\right) \times \frac{ \partial }{ \partial t }\left( \begin{array}{c} s \\ r \\ \end{array}\right)=\left( \begin{array}{c} s\frac{ \partial r }{ \partial x } + r\frac{ \partial s }{ \partial x } \\ 2\frac{A}{B}r\frac{ \partial r }{ \partial x } +\frac{ \partial s }{ \partial x }\\ \end{array}\right)+\frac{ \partial }{ \partial x }\left( \begin{array}{c} \frac{ \partial s }{ \partial x } \\ \frac{A}{-K}\frac{ \partial r }{ \partial x } \\ \end{array}\right)+\left( \begin{array}{c} 0 \\ 0 \\ \end{array}\right) $$
In MATLAB:
function [c,f,s] = eqtn(x,t,u,DuDx)
c = 1;
f = ????
s = 0;
How to code the function $f$?