Finite difference method problem with solving an equation
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Aldo
el 8 de Nov. de 2016
Comentada: Torsten
el 10 de Nov. de 2016

Trying to use Finite difference method, to write the equation in AT = b matrices. But I don't know how to write FDM on that type of equation, please see image.
0 comentarios
Respuesta aceptada
Torsten
el 8 de Nov. de 2016
(k(x_(i+1/2))*(T(x_(i+1))-T(x_(i)))/(x_(i+1)-x_(i))-k(x_(i-1/2))*(T(x_(i))-T(x_(i-1)))/(x_(i)-x_(i-1)))/(x_(i+1/2)-x_(i-1/2)) = Q(x_i)
with
x_(i+1/2)=(x_(i+1)+x_(i))/2
x_(i-1/2)=(x_(i)+x_(i-1))/2
Best wishes
Torsten.
0 comentarios
Más respuestas (5)
Torsten
el 8 de Nov. de 2016
[d/dx(k*dT/dx)](x) ~ (k(x+h/2)*(dT/dx)(x+h/2) - k(x-h/2)*(dT/dx)(x-h/2))/h
Approximations for (dT/dx)(x+h/2) and dT/dx(x-h/2) are
(dT/dx)(x+h/2) ~ (T(x+h)-T(x))/h
(dT/dx)(x-h/2) ~ (T(x)-T(x-h))/h
Now insert in the first equation.
The finite-difference approximation in my first response was more general because it took into account non-equidistant grids (i.e. h is not fixed over the complete interval). But note that I missed the minus-sign in front of the approximaton for d/dx(k*dT/dx).
Best wishes
Torsten.
0 comentarios
Torsten
el 9 de Nov. de 2016
-(k(x_(i+1/2))*y_(i+1)-(k(x_(i+1/2))+k(x_(i-1/2)))*y_(i)+k(x_(i-1/2))*y_(i-1))/h^2 = Q(x_(i))
with
x_(i+1/2)=(x_(i)+x_(i+1))/2
x_(i-1/2)=(x_(i-1)+x_(i))/2
for i=2,...,(n-1)
y(1) and y(n) are given by your boundary conditions.
So to incorporate the boundary conditions, you can add the equations
y(1) = 300
y(n) = 410
to the system from above.
The complete system to be solved then looks like
y(1) = 300
-(k(x_(i+1/2))*y_(i+1)-(k(x_(i+1/2))+k(x_(i-1/2)))*y_(i)+k(x_(i-1/2))*y_(i-1))/h^2 = Q(x_(i)) (i=2,...,n-1)
y(n) = 410
Best wishes
Torsten.
0 comentarios
Ver también
Categorías
Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

