(71B) Implicit Trapezoidal Integration Method for ODE
|
02-23-2024, 10:06 PM
(This post was last modified: 02-23-2024 10:07 PM by Namir.)
Post: #1
|
|||
|
|||
(71B) Implicit Trapezoidal Integration Method for ODE
Implicit Trapezoidal Integration Method for ODE
================================================ Given f(x,y) and (x0,y0) as the initial point, xf as the final point, h is the integration step, toler as the tolerance value. The function to solve for y1 is: F(y1) = y1 - y0 - h/2*(f(x0,y0) + f(x1,y1)) The loop to calculate y at x=xf is: Code: While x0 < xf Instructions ============ 1) Define the differential equation at line 30. FNF should be a function of X and/or Y. 2) Edit the DATA statement in line 60 to contain the following values: 2.1) The value for the initial X. 2.2) The value for the initial Y. 2.3) The value for the final X. 2.4) The value for the integration step. 2.5) The tolerance value for solving the implicit step. 2.6) The number of results to skip storing in the results matrix R. Can be 0. 3) Press RUN. The program displays the current values of X. The program then displays the final value of Y. Finally the program displays the paired values of X and Y stored in the results matrix R. Example ======= given the ODE dy/dx = -2*y, x0=0, y0=1, xf=1, h=0.1, tolerance=1e-6. The matrix R stores the rows of (x, y) values, skipping every 0 values. Press RUN. The program displays X values and then the final Y value as "Y = 0.13443063275". Press [f][Cont] to view the paired values of X and Y stored in matrix R. The last value is the final value of Y. Program Listing =============== Code: 10 REM IMPLICIT TRAPEZOIDAL ODE |
|||
02-25-2024, 05:02 PM
Post: #2
|
|||
|
|||
RE: (71B) Implicit Trapezoidal Integration Method for ODE
.
Your 1,000th post, Namir, congratulations ! V. All My Articles & other Materials here: Valentin Albillo's HP Collection |
|||
02-25-2024, 10:57 PM
Post: #3
|
|||
|
|||
RE: (71B) Implicit Trapezoidal Integration Method for ODE | |||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)