Insights Blog
-- Browse All Articles --
Physics Articles
Physics Tutorials
Physics Guides
Physics FAQ
Math Articles
Math Tutorials
Math Guides
Math FAQ
Education Articles
Education Guides
Bio/Chem Articles
Technology Guides
Computer Science Tutorials
Forums
Intro Physics Homework Help
Advanced Physics Homework Help
Precalculus Homework Help
Calculus Homework Help
Bio/Chem Homework Help
Engineering Homework Help
Trending
Featured Threads
Log in
Register
What's new
Search
Search
Search titles only
By:
Intro Physics Homework Help
Advanced Physics Homework Help
Precalculus Homework Help
Calculus Homework Help
Bio/Chem Homework Help
Engineering Homework Help
Menu
Log in
Register
Navigation
More options
Contact us
Close Menu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Homework Help
Engineering and Comp Sci Homework Help
Simpson's rule with changing volumes
Reply to thread
Message
[QUOTE="noelll, post: 5438989, member: 586976"] Hi, Thank you so much for your reply, yes the immersed volume of the lifeboat is changing as it enters the water and i would need to evaluate a new volume each sec, when it dives in. However, i tried doing a while loop, and my code just kept running, my knowledge in MATLAB is at beginner's level, but i am keen to learn so i hope you could teach me what to do? [code] %INPUTS L = 0; %lower limit U = 8.5; % upper limit n = 40; % number of segments Length = 1; Breath = 3; Height = 2.3; density= 1.025; g = 9.81; func = @(x) (Breath * Height); h = (U-L)/n; st4 = 0; st2 = 0; while (i < 40) for i = 2:h:n st4 = st4 + 4*func(i); end for i = 3:h:n st2 = st2 + 2*func(n); end Buoyancy_Force = (density*g)*(h/3*(func(1)+st4+st2+func(i))); end disp (Buoyancy_Force) fprintf('step %.3f\n',i); disp (st4) disp (st2)[/code] The following while loop i used i<40 , the reason why i put that was, i divided the lifeboat into 40 strips and so i was thinking my simpson's rule could evaluate at every i interval till it reached the 40th strip and stop. Please help! Thank you!, Best Regards, Noel [/QUOTE]
Insert quotes…
Post reply
Forums
Homework Help
Engineering and Comp Sci Homework Help
Simpson's rule with changing volumes
Back
Top