Question: Need Help in reviewing my code for the following problem statement. Consider a horizontal circular cylinder with diameter 0.31m and length 1.68m lying in a

Need Help in reviewing my code for the following problem statement. Consider a horizontal circular cylinder with diameter 0.31m and length 1.68m lying in a bathtub. The cylinder has a density of 989 kg/m3 and the water in the bathtub has a density of 1000 kg/m3. The acceleration due to gravity is 9.81 m/s2. Calculate the height of the cylinder above the water using the Bisection and False Position methods, with a range of 0 Need Help in reviewing my code for the following problem statement. Considera horizontal circular cylinder with diameter 0.31m and length 1.68m lying ina bathtub. The cylinder has a density of 989 kg/m3 and the I have posted the code snippets in order. kindly help me review my code and if u can explain what im doing wrong that'd be great thank you. Kindly explain what's wrong with the code if you can or explain your own code

\% Constants d=0.33;% diameter of the cylinder [m] I=1.65;% length of the cylinder [m] P_body =983;% density of the body [kg/m3] P_water =1000;% density of the water [kg/m3] g=9.81;% acceleration due to gravity [m/s2] \% Function to calculate the volume of the cylinder that is submerged in water V=(h)pi/4d2(1(1h)); \% Function to calculate the force of buoyancy acting on the cylinder F_buoy =(h) P_water gV(h); \% Function to calculate the weight of the cylinder W=@(h) P_body gV(h); \% Function to calculate the net force acting on the cylinder F_net =@(h) F_buoy (h)W(h); \% Function to solve for the height h using False position method Falseposition =@(h,F_net, tol, N_max) a=0; b=0.5; c=0; N=; while N tol N=N+1; c=(aF_met(b)bF_net(a))/(F1 _net (b) - F_net (a)); if Fnet(c)==0 break end if F_net(c) * F_net(a) <_max>

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!