Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Matlab question! MATLAB grader problems: HW3_2 According to Archimedes, if a solid that is lighter than a fluid is placed in the fluid, the solid
Matlab question!
MATLAB grader problems: HW3_2 According to Archimedes, if a solid that is lighter than a fluid is placed in the fluid, the solid will be immersed to such a depth that the weight of the solid is equal to the weight of the displaced fluid. To find the depth, x, at which the ball floats, this equation must be solved: x 3 PcVc = Pw 'W TTXr -- 3 x 2 Find the floating depth for a cork ball of radius 2 cm whose density (pc) is one-fifth that of water using a) Newton-Raphson method and b) secant method. Determine the root to an accuracy of 3 sig figs. Do not use newtraph.p or secant.p. Write your own code to implement the algorithms and solve. Verify your work on Cody. The functions on Cody have the starting guesses as the input arguments, and the root as the output argument. Newton-Raphson O solutions submitted (max: Unlimited) Function function root = mynewtraphcork(x1) 2 %compute the root of an equation using Newton-Raphson 3 % 4 %root = mynewtraphcork (x1) %INPUT %OUTPUT X1: a guess at the root root: the root of pi x^2 r - pi x^3/3 - rho V. Depth at which the cork will be submerged end Code to call your function Secant method O solutions submitted (max: Unlimited) Function function root = mysecantcork(x0, x1) 2 %compute the root of an equation using Newton-Raphson % %root = mysecantcork(x0,x1) ovu w %INPUT %OUTPUT X0,X1: two guesses root: the root of pi x^2 r - pi x^3/3 - rho V. Depth at which the cork will be submerged end Code to call your function MATLAB grader problems: HW3_2 According to Archimedes, if a solid that is lighter than a fluid is placed in the fluid, the solid will be immersed to such a depth that the weight of the solid is equal to the weight of the displaced fluid. To find the depth, x, at which the ball floats, this equation must be solved: x 3 PcVc = Pw 'W TTXr -- 3 x 2 Find the floating depth for a cork ball of radius 2 cm whose density (pc) is one-fifth that of water using a) Newton-Raphson method and b) secant method. Determine the root to an accuracy of 3 sig figs. Do not use newtraph.p or secant.p. Write your own code to implement the algorithms and solve. Verify your work on Cody. The functions on Cody have the starting guesses as the input arguments, and the root as the output argument. Newton-Raphson O solutions submitted (max: Unlimited) Function function root = mynewtraphcork(x1) 2 %compute the root of an equation using Newton-Raphson 3 % 4 %root = mynewtraphcork (x1) %INPUT %OUTPUT X1: a guess at the root root: the root of pi x^2 r - pi x^3/3 - rho V. Depth at which the cork will be submerged end Code to call your function Secant method O solutions submitted (max: Unlimited) Function function root = mysecantcork(x0, x1) 2 %compute the root of an equation using Newton-Raphson % %root = mysecantcork(x0,x1) ovu w %INPUT %OUTPUT X0,X1: two guesses root: the root of pi x^2 r - pi x^3/3 - rho V. Depth at which the cork will be submerged end Code to call your functionStep 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