Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
These are the equtions I am solving for:
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 WindowStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started