Question: write a matlab or python code We consider the boundary value problem u ' ' + u 3 = c o s x , xin

write a matlab or python code
We consider the boundary value problem
u''+u3=cosx,xin(0,1)
u(0)=0
u(1)=0
a) By approximating u' with the central difference formula
u'~~um+1-um-12h
with h being the mesh size and um the approximation of u(tm). Show that the boundary value problem
is reduced to a system of nonlinear equations of the form Ax+Nx=b where A is linear part and N
is a nonlinear part, and x is the unknown and b is a vector.
b) write a computer program to solve the nonlinear system obtained in (a)
for h=10-1,10-2,10-3,10-4,10-5,10-6,10-7,10-8
c) Find the convergence and compute the rate of convergence.
d) repeat the exercise if one considers
u'(tm)~~um+1-umh,( forward scheme )
g)repeat the exercise if
u'(tm)~~um-um-1h,( backward scheme )
We assume that the second derivative in all situations is approximated as follows
u''(tm)~~um+1-2um+um-1h2
 write a matlab or python code We consider the boundary value

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!