I want to solve the partial differential equation
$$u_{x}(x,y) + f(x)u_{y}(x,y) = f(0)u(0,y),~~x \in (0,A),~ y \in (0,B) $$
$$ u(A,y)=0$$ $$u(x,B)=0 $$ using a finite difference scheme. If I used the explicit finite difference scheme, then I got
$$ u(m+1,n) - u(m,n) + f(m)(u(m,n+1)-u(m,n))=f(1)u(1,n) $$ $$u(M,n)=0; u(m,N)=0 $$ where $m=1,2,...,M$ and $n=1,2,...,N$ and $u(m,n) = u(x(m),y(n))$. But here $u(1,n)$ is unknown and I am getting problem to determine $u(2,n)$. To get rid of this problem, I used the transformation $x=x_{1}+A,y=y_{1}+B$ to change boundary conditions to $u(0,y_{1}+B)=u(x_{1}+A,0)=0$, but then $f(0)$ is changed into $f(-A)$. This creates problem to write finite difference scheme in Matlab. Please help me to write finite difference scheme to this problem.