请教有谁用过matlab编过ritz galerkin method解偏微分方程的马?
Consider the two-point boundary value problem
􀀀y00 + y = (2 + 1) sin(x); x 2 (0; 1)
y(0) = 1; y0(1) = 1
2 e 􀀀 1
e 􀀀
(1)
It is easy to verify that the solution to this problem is
y(x) =
1
2 ex + e􀀀x + sin(x)
(Note that MatLab has a built-in value for . Read \help pi" in MatLab. Moreover,
you can compute e in MatLab from exp(1).)
Write a MatLab program that uses the Ritz-Galerkin method with piecewise linear chapeau
(i.e., hat) basis functions (dened on page 176 of your textbook) on an equally
spaced grid to solve the two-point boundary value problem (1). That is, let the gridpoints
be xi = ih for i = 0; 1; : : : ;m and h = 1=m, where m is an integer. (See below
for the choices of m.)


雷达卡


京公网安备 11010802022788号







