need help in solving 2nd order ODE using finite difference method: central scheme

 採用された回答

Torsten
Torsten 2016 年 3 月 21 日

0 投票

What are your boundary conditions ?
Best wishes
Torsten.

6 件のコメント

deepak dalal
deepak dalal 2016 年 3 月 21 日
Only intial condition is given 0<x<1
Let me cross check with teacher.
Thanks for your reply
Torsten
Torsten 2016 年 3 月 21 日
Since your problem is not time-dependent, initial conditions are only important for convergence. Boundary conditions are the important issue.
Best wishes
Torsten.
deepak dalal
deepak dalal 2016 年 3 月 21 日
boundary condition: u = 0 at x = 0 and x = 1
thanks
Torsten
Torsten 2016 年 3 月 21 日
編集済み: Torsten 2016 年 3 月 21 日
Then you will have to solve the linear system of equations
u(1)=0
(u(i+1)-2*u(i)+u(i-1))/(dh)^2=-(2*pi)^2*sin(2*pi*(i-1)*dh) (2<=i<=n-1)
u(n)=0
with
dh=1/(n-1)
See whether MATLAB supplies a solver for tridiagonal systems of linear equations.
Best wishes
Torsten.
deepak dalal
deepak dalal 2016 年 3 月 21 日
I can not use any solver tool. I have to write a matlab code for getting solution. do you have code for similar boundary layer problem.
The linear system has the form
A*u=b
Set up A and b and solve for u using u=A\b.
Best wishes
Torsten.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLinear Algebra についてさらに検索

質問済み:

2016 年 3 月 21 日

コメント済み:

2016 年 3 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by