Question: I am given this matlab code which solves the boundary derivatives for two point forward and two point backward accuracy schemes. I need to change

I am given this matlab code which solves the boundary derivatives for two point forward and two point backward accuracy schemes. I need to change the code to solve for 3 point forward and 3 point backward boundary schemes.I am given this matlab code which solves the boundary derivatives fortwo point forward and two point backward accuracy schemes. I need to

These are the equtions I am solving for:

change the code to solve for 3 point forward and 3 point

MATLAB R2018b-academic use PLOTS EDITOR PUBLISHMEW Find Files Compare Sa Print GoTo Comment %23 Breakpoints RunRun and Advance Run and Advance New Open Save Find Time UsrsKevin SterlingDesktopMatlabLabsKevin Sterling Lab 4Chapter8 Partial Current Folder Editor-CAUsers Kevin Sterling\Desktop\Matlab\Labs Kevin Sterling Lab 4\Chapter8 PartiaMEX4.m Name EX4.m 2-load ('reaults.mat') %Write the velocity components into array of 250x51 uxx- reshape (ux, lx, ly) 5-1 uyy = reshape (uy, 1 x, ly) ; 6-dudy (250,51)-0.0 7dvdx (250,51)-0.0 Calculate the two derivatives in the whole domain 9- for i-1 : 250 for 1:51 if (i1&51) 13 elseif (1 &j51) dvdx (i,j)-(uyy (i+1,j)-uyy(i,j))/(itl - i)i elseif (250&&-1) 18- dudy (i.j)-(uxx (i,j+1)-uxx(i,5))/5+1-j) elseif (250&&J51) elseif (i-1&& j > 1 j 1 && j 1 &&i250&j51) dudy (1,j)(uxx (1,j) - uxx(i,j-1))j-j-1)) dvdx (,j)(uyy (+1,j)-uyy (i-1,j))/(i+1 - (-1)) dudy (i,j)(uxx (i,j+1)ux (i,j-1))/(j+1-j-1)) dvdx (i 1+1-(1-1)) Command Window MATLAB R2018b-academic use PLOTS EDITOR PUBLISHMEW Find Files Compare Sa Print GoTo Comment %23 Breakpoints RunRun and Advance Run and Advance New Open Save Find Time UsrsKevin SterlingDesktopMatlabLabsKevin Sterling Lab 4Chapter8 Partial Current Folder Editor-CAUsers Kevin Sterling\Desktop\Matlab\Labs Kevin Sterling Lab 4\Chapter8 PartiaMEX4.m Name EX4.m 2-load ('reaults.mat') %Write the velocity components into array of 250x51 uxx- reshape (ux, lx, ly) 5-1 uyy = reshape (uy, 1 x, ly) ; 6-dudy (250,51)-0.0 7dvdx (250,51)-0.0 Calculate the two derivatives in the whole domain 9- for i-1 : 250 for 1:51 if (i1&51) 13 elseif (1 &j51) dvdx (i,j)-(uyy (i+1,j)-uyy(i,j))/(itl - i)i elseif (250&&-1) 18- dudy (i.j)-(uxx (i,j+1)-uxx(i,5))/5+1-j) elseif (250&&J51) elseif (i-1&& j > 1 j 1 && j 1 &&i250&j51) dudy (1,j)(uxx (1,j) - uxx(i,j-1))j-j-1)) dvdx (,j)(uyy (+1,j)-uyy (i-1,j))/(i+1 - (-1)) dudy (i,j)(uxx (i,j+1)ux (i,j-1))/(j+1-j-1)) dvdx (i 1+1-(1-1)) Command Window

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!