How to find the derivative without using a symbolic function in Matlab?

Question in MatLab by using fminbnd function?

  • A water tank consists of a cylindrical part of radius r and height h, and a hemispherical top. The tank is to be constructed to hold 500 m^3 when filled. The surface area of the cylindrical part is 2*pi*r*h, and its volume is pi*r^2*h. The surface area of the hemispherical top isgiven by 2*pi*r^2, and its volume is given by (2*pi*r^3) / 3. The cost to construct the cylindrical part of the tank is $300 per square meter of surface area; the hemispherical part costs $400 per square meter. Use the fminbnd function to compute the radius that results in the least cost. Compute the corresponding height h. This is such a hard problem and do it in matlab. Anyone please me..thx alot

  • Answer:

    first: look at your given equations. 1) V = 500m3 = pi*r^2*h + (2/3)*pi*r^3 2) SA = 2*pi*r*h + 2*pi*r^2 you want to minimize the cost of the surface area using 2 different prices, so you need to assign a "weight" to the cylinder SA and hemisphere SA. SA = 300*(2*pi*r*h) + 400*(2*pi*r^2) now, you need to turn SA into a function of r only. Use eqn 1) to solve for h. Substitute h into SA. Minimize this SA using fminbnd. Open a new M-file in matlab. Create your function: f = @(r)SA Use the fminbnd: x = fminbnd(f,r1,r2) r1 and r2 are your lower and upper limits for the bounds. Hint: r1 > 0, r2 < 10 M-file: f = @(r)SA x = fminbnd(f,r1,r2) once you know r, you can go back and find h using eqn 1) A note: When you create your function f, you need the @(r) to define it as a function. Try using Matlab's help for fminbnd and look at the examples. Hopefully you can make sense of this. So you can check your results: 1<h<2 5<r<6

JW32 at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.