Method of Weighted Residual on the HP 28S +- HP Forums (http://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: Method of Weighted Residual on the HP 28S (/thread-7920.html) |
Method of Weighted Residual on the HP 28S - mbrethen - 03-10-2017 10:18 PM Prior to development of the Finite Element Method, there existed an approximation technique for solving differential equations called the Method of Weighted Residuals (MWR). In order to explain the method, consider the example problem in the attached pdf. A trial function, u = ax(1-x), is selected as an approximate solution to the differential equation. The trial function is chosen such that it satisfies the boundary conditions and it has one unknown coefficient to be determined. Once a trial function is selected, the residual R is computed by substituting the trial function into the differential equation. Because u is different from the exact solution, the residual does not vanish for all values of x within the boundary values. The next step is to determine the unknown constant a such that the chosen test function best approximates the exact solution. For Galerkin's method, the test function w comes from the chosen trial function, i.e. w = du/da and the weighted average of the residual over the problem domain is set to zero. GALERKN ( Galerkin method of weighted residuals ) Program Code: << The most straightforward method of defining R is to store the program DEQ: Code: << -> u x << u x ∂ x ∂ u - x + >> >> Execute GALERKN with three arguments, as follows:
The program returns the trial function with a = 0.22727 (runtime ~1 min 48 sec). It is shown plotted with the exact solution for 0<x<1. In order to improve the approximation another term is added to the trial function, u = a1x(1-x) + a2x^2(1-x). This solution took about 31 min. RPL calculators never had a simultaneous equation solver until the MSLV function on the 49 series. Mike Ingle wrote the code TMSLV for the 48GX and HP-28C&S. It can be found elsewhere on the web. Edit: I have included Matlab output in the pdf comparing the second solution for 2 unknown coefficients in the trial function. |