3 views (last 30 days)

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

Torsten
on 13 Aug 2019

Edited: Torsten
on 13 Aug 2019

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}.

Torsten
on 15 Aug 2019

Take (A-5) and (A-7) to calculate W_{0}^{m}.

This is the missing boundary value at x=0.

In the last program I posted, you just have to replace b(1) by this value.

Torsten
on 15 Aug 2019

From your equations, you have to change C1 and C2 accordingly, don't you ?

I wonder where the (delta_x)^2 in the denominator of C1 has gone ...

Sign in to comment.

Sign in to answer this question.

Opportunities for recent engineering grads.

Apply Today
## 6 Comments

## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/475926-solving-ax-b-with-both-unknowns-in-a-and-b#comment_734465

⋮## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/475926-solving-ax-b-with-both-unknowns-in-a-and-b#comment_734465

## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/475926-solving-ax-b-with-both-unknowns-in-a-and-b#comment_734467

⋮## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/475926-solving-ax-b-with-both-unknowns-in-a-and-b#comment_734467

## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/475926-solving-ax-b-with-both-unknowns-in-a-and-b#comment_734469

⋮## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/475926-solving-ax-b-with-both-unknowns-in-a-and-b#comment_734469

## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/475926-solving-ax-b-with-both-unknowns-in-a-and-b#comment_734471

⋮## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/475926-solving-ax-b-with-both-unknowns-in-a-and-b#comment_734471

## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/475926-solving-ax-b-with-both-unknowns-in-a-and-b#comment_734473

⋮## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/475926-solving-ax-b-with-both-unknowns-in-a-and-b#comment_734473

## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/475926-solving-ax-b-with-both-unknowns-in-a-and-b#comment_734476

⋮## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/475926-solving-ax-b-with-both-unknowns-in-a-and-b#comment_734476

Sign in to comment.