Finite Difference Method to find Steady State

Hello experts,
I have to solve the following equation to find a converged solution.
At i=0, T=10 and at i=5, T=50. (n=5)
I want to get the converged solution of T at i=2, 3, 4.
I'm fairly comfortable with MATLAB but this is the first time that I'm using MATLAB for these kind of mathematical approach and I'm learning completely alone, relying on online materials.
How should I approach this? I'd appreciate your recommendations, reading materials, suggestions and/or pointers rather than a complete code at this point.
I know the question is vague but I'd welcome any suggestions for starting points :)
TIA!

댓글 수: 3

Torsten
Torsten 2020년 4월 8일
What are the values for T_i^n for n =0 ?
Jake
Jake 2020년 4월 8일
Apologies, I've missed including that info properly.
When n=0, T_i^(n+1)=10, 73, 100, 85, 50 respectively at i=1, 2, 3, 4, 5.
Hello experts,
I am trying to solve the finite difference methof for crank nicolson scheme to 2d heat equation. please let me know if you have any MATLAB CODE for this
Boundary codition are
If you can kindly send me the matlab code, it will be very useful for my research work . thank you very much.

댓글을 달려면 로그인하십시오.

 채택된 답변

Torsten
Torsten 2020년 4월 8일
편집: Torsten 2020년 4월 9일

0 개 추천

T = zeros(6,5);
T(1:6,1) = 10;
T(1:6,5) = 50;
T(1,2) = 73;
T(1,3) = 100;
T(1,4) = 85;
for n=1:5
for i =2:4
T(n+1,i) = T(n,i) + 0.3*(T(n,i+1)-2*T(n,i)+T(n,i-1));
end
end
T

댓글 수: 5

darova
darova 2020년 4월 8일
Torsten
Torsten 2020년 4월 8일
Thank you for formatting. Unfortunately, I can't use the editor options at the screen I'm currently working on.
Jake
Jake 2020년 4월 9일
편집: Jake 2020년 4월 9일
This works!
However, I noticed that I haven't stated my question correctly. To find the converged solution, equation has to be iterated until the steady state approaches. I will start a new thread, properly stating the question.
Edit: I posted the question again, hopefully it makes more sense now.
Torsten
Torsten 2020년 4월 9일
Either choose a larger value than 5 for n or solve directly the linear system dT/dt = 0, i.e.
T(1) = 10
T(i+1) - 2*T(i) + T(i-1) = 0 (i=2,3,4)
T(5) = 50
Jake
Jake 2020년 4월 9일
Thank you, Torsten. I think that was what I wanted. It was my fault that I didn't post the question correctly :)
I'm still learning and I will try your suggestion.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

질문:

2020년 4월 8일

댓글:

2020년 11월 6일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by