PLEASE PROVIDE MATLAB CODE FOR THE QUESTION
BELOW.
a system of n algebraic equations for the y; by replacing the second derivative in the differential equation by the finite difference approximation Yi+1 - 2y + yi-1 h² i = 1,..., n. Use a library routine, or one of your own design, to solve the resulting system of non- linear equations. A reasonable starting guess for the nonlinear solver is a straight line between the boundary values. Plot the sequences of solutions you obtain for n = 1, 3, 7, and 15. (c) Collocation method. Divide the given interval 0≤t≤1 into n 1 equal subintervals, 0=ti<t2<…<tn-i<tn = 1, with each subinterval of length h = 1/(n-1). Take the approximate solution v(t, x) to be a polyno- mial of degree n - 1 with coefficients . Forcing v(t, x) to satisfy the boundary conditions at the endpoints and to satisfy the ODE at the n - 2 in- terior points yields a system of n equations that 0 < t < 1, 10.1. Solve the two-point BVP u" = 10u³ + 3u + t², with boundary conditions u (0) = 0, u(1) = 1, by each of the following methods. (a) Shooting method. Use a one-dimensional non- linear equation solver to find an initial slope u'(0) such that the solution of the resulting initial value problem hits the target value for u(1). Solve each required initial value problem using a library ODE solver or one of your own design. Plot the se- quence of solutions you obtain. (b) Finite difference method. Divide the given in- terval 0 < t < 1 into n + 1 equal subintervals, 0= to <t₁ < <tn<tn+1 = 1, = with each subinterval of length h 1/(n + 1). Let yi, i = 1,..., n, represent the approximate solution values at the n interior points. Obtain determine the n coefficients of the polynomial v(t, x). Use a library routine, or one of your own design, to solve this system of nonlinear algebraic equations. The resulting polynomial can then be evaluated at any point in the interval to obtain an approximate solution value at that point. Print the polynomial coefficients and plot the solutions you obtain for n = 3, 4, 5, and 6.
PLEASE PROVIDE MATLAB CODE FOR THE QUESTION BELOW.
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
PLEASE PROVIDE MATLAB CODE FOR THE QUESTION BELOW.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!