Insights Blog
-- Browse All Articles --
Physics Articles
Physics Tutorials
Physics Guides
Physics FAQ
Math Articles
Math Tutorials
Math Guides
Math FAQ
Education Articles
Education Guides
Bio/Chem Articles
Technology Guides
Computer Science Tutorials
Forums
Intro Physics Homework Help
Advanced Physics Homework Help
Precalculus Homework Help
Calculus Homework Help
Bio/Chem Homework Help
Engineering Homework Help
Trending
Featured Threads
Log in
Register
What's new
Search
Search
Search titles only
By:
Intro Physics Homework Help
Advanced Physics Homework Help
Precalculus Homework Help
Calculus Homework Help
Bio/Chem Homework Help
Engineering Homework Help
Menu
Log in
Register
Navigation
More options
Contact us
Close Menu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Homework Help
Engineering and Comp Sci Homework Help
Using finite difference to solve DE
Reply to thread
Message
[QUOTE="Simon Bridge, post: 5532872, member: 367532"] It is best to [I]understand[/I] the techniques you are applying instead of just going through the motions by rote. Note: post #1, under "relevant equations", check that first expression. If ##D^2_iy## indicates the second derivative of ##y(x)## evaluated at point ##x=x_i : i\in\mathbb{Z}## then: $$D^2_iy \approx \frac{y_{i+1}-2y_{i}+y_{i-1}}{h^2}: y_i=y(x_i)$$ ... here I used ##h=\Delta x## to avoid typing lots of deltas. However, this expression may be inconsistent with the second expression in the same section. If ##D_iy\approx\frac{1}{2h}\big(y_{i+1}-y_{i-1}\big)## then: ##D_i^2y \approx \frac{1}{4h}\big(D_{i+1}y-D_{i-1}y\big)## ... so it kinda helps to know where you are coming from. This would make the matrix for a second order DE potentially quin-diagonal. But I don't think it's a fatal problem since these are only approximations anyway. Now, using this notation... I can define a vector ##\vec x = \big(x_0,x_1,x_2,\cdots x_n,\cdots x_{N-2},x_{N-1}\big)^t : x_n=x_0+nh## ... for the N discrete points you want to do your evaluation over. (The "##^t##" indicates a transpose so this is [I]defined[/I] to be a column vector.) I can derive, from that, other vectors like: ##\vec y = \big(y_0,y_1, \cdots y_n, cdots y_{N-1}\big)^t:y_n=y(x_n)## and, similarly ##\vec y' = \big(y'(x_0)\cdots\big)^t## etc. You follow me so far? When I look at the relationships, I can see that ##\vec y' = D\vec y## where ##D## is a matrix that looks like this: $$D=\frac{1}{2h}\begin{bmatrix} 0 & 1 & 0 &\cdots\\ -1 & 0 & 1 & 0 & \cdots\\ 0 & -1 & 0 & 1 & 0 & \cdots\\ \cdots & 0 & -1 & 0 & 1 & 0 & \cdots\\ & & \ddots & \ddots & \ddots & \ddots & \ddots & &\\ \end{bmatrix}$$ ... ie, this is a tri-diagonal matrix where the diagonal elements are (-1,0,1) times a constant (1/2h). This follows from your definition in post #1 (section 2, 2nd equation). You should check, if you have not already. OTOH: If we follow the definition of the derivative given in math textbooks you get a tri-diagonal matrix with elements (0,-1,1)/h. ... however you do it, it also follows that ##\vec y'' = D\vec y' = D(D\vec y) = D^2\vec y## Thus any DE can, with a bit of care, be rewritten as a matrix equation. Yours is (from post #1): Which is ##D^2\vec T = 5D\vec T - 0.1\vec x ## Where ##h=2, T(0)=T(x_0)=T_0=50, T(10)=T(x_{175})=T_{175} = 400## Rearrange, you get ##A\vec T = \vec x## where ##A=50D-10D^2##. The solution, therefore, amounts to finding the inverse of the matrix A. [/QUOTE]
Insert quotes…
Post reply
Forums
Homework Help
Engineering and Comp Sci Homework Help
Using finite difference to solve DE
Back
Top