MATLAB: Solving Ax=b with both unknowns in A and b

linear systemmatrix problemsymbolictridiagonal

Anyone please help me with this problem. I only know some basic when it comes to matlab and having lots of difficulties trying to code this matrix problem Ax=b that have unknown in both A and b.
The linear system obtained in the form of
where are constants, m is time step, , (initial and boundary values – W at t=0 and W at the last node and outside =0)
How to create the tridiagonal matrix A and vector b in matalb please? I tried to search similiar codes but only found the equations where A and b are known…in this case A and b have symbolic arguments in power form and they are related to the solution

Best Answer

Now if W_{0}^{m} and W_{N+1}^{m} are 0 (I think you meant W_{0}^{m} instead of W_{N}^{m}), you have a system of N equations in W_{1}^{m},...,W_{N}^{m}.
You can use Walter's suggestion to solve for W_{1}^{m+1},...,W_{N}^{m+1}.
I don't understand why you write that there are unknowns in A and b. The W's in A and b are the W's from the last time step (m) and thus known. The unkowns are W_{1}^{m+1},...,W_{N}^{m+1}.
Related Question