I am tring to use chebfun to solve the following system of equation: \begin{cases} v_t+u_x+(uv)_x+au_{xxx}=0\\u_t+v_x+(u^2/2)_x+cv_{xxx}=0\end{cases}
I mimic the code for the scalar PDE, here is what I wrote:
dom = [0 40];
a=1/6;c=1/6;
tspan = [0 1];
S = spinop(dom,tspan);
S.lin = @(v,u) [diff(u)+a*diff(u,3); diff(v)+c*diff(v,3)];
S.nonlin = @(v,u) [diff(u.*v);0.5*diff(u.^2)];
S.init = [chebfun(@(x)-1+3/2*(sech(3/sqrt(6)*(x-20))).^2, dom);...
chebfun(@(x)3/sqrt(2)*(sech(3/sqrt(6)*(x-20))).^2, dom)];
spin(S,200,0.01,'plot','off');
It always return error.
Your nonlinearity seems to not be supported by chebfun's solver. This differential equation with 2 variables on a 1d domain gets solved without errors:
(There were also some missing sign flips in your code compared to your posted equations.)
Maybe give dedalus a shot to solve your nonlinear problem: https://dedalus-project.org/