Matlab code required for 2nd order 2 point BVP
显示 更早的评论
To keep things simple, consider only 2-point BVPs of the form
u′′ + q( x)u = r ( x)
subject to Dirichlet BCs u(a) = α, u(b) = β.
In order of difficulty:
Write a Matlab function with the following declaration
function u = BvpFD(q,r,a,b,alpha,beta,N)
that solves such a BVP using 2nd order central differences, constants a, b, α, β and
integer N which defines the uniform 1D mesh x1·····xN+1. Although q, r could be
function handles in simple cases, write your code so that q, r are vectors
containing the values
q ( xj ),r ( xj ), j = 1⋯N +1
This means you will have to define the mesh before you call BvpFD.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Partial Differential Equation Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!