Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

2) In this exercise, you will be writing your own function, sineval,which will u

ID: 3603253 • Letter: 2

Question

2) In this exercise, you will be writing your own function, sineval,which will use a quadratic spline to compute approximations for the sine function at any real number. You are to compute the quadratic spline S(x) using evenly-spaced nodes xi , , where x,,-x. = for k = 1,2, , n-1, and whose derivative is specified at xi. The numbers y,.yu , y, are the corresponding function values to be interpolated. On each interval [i,4. S(x) = S,(x) = a, th(x-4)+6(x-xi ), k=1.2 ,n-1 After applying the interpolation conditions, one obtains a& =y; 1,2 , n-1 (1) and y,-i-y, k = 1,2, , n-1 (2) ; After applying the smoothness conditions, one obtains If S(x)v, (derivative is specified to be v), then one obtains bv(4) Page 3 of 4 Use Equs. (3) and (4) to set up a linear system to solve for vector b that contains the coefficients bi,h,, a) ,b-i . Write down an example system' for n 5.

Explanation / Answer

ANSWER::

function [x,y] = rqe2(a,b,c)
x = (-b + sqrt(b^2 - 4 * a * c))/(2*a);
y = (-b - sqrt(b^2 - 4 * a * c))/(2*a);

2x2 + x - 1 = 0


x = rqe(2, 1, -1)

x = 0.5000 -1.0000

[m, n] = rqe2(2, 1, -1)

m = 0.5000

n = -1

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote