(adsbygoogle = window.adsbygoogle || []).push({}); That's all I got so far we have to do this:Code (Text):#include <iostream>

#include <cstdlib>

#include <cmath>

using std::cout;

using std::endl;

using std::cin;

int main()

{

double h,v,w,z,y;

cout << "Enter the width, W: ";

cin >> w;

if (w<0)

{

cout << "Error: The Width must be strictly positive." << endl;

return EXIT_FAILURE;

}

cout << "Enter the height, H: ";

cin >> h;

if (h<0)

{

cout << "Error: The Height must be strictly positive." << endl;

return EXIT_FAILURE;

}

x=(6*x*x)+(x(-2h-2w))+((h*w)/2); // is this my x?

y=((w/2)-x);

z=(h-2x);

v=(2*x*x*x)-(h*x*x)-(w*x*x)+((h*w)/2)

return EXIT_SUCCESS;

}

I've already found the derivative, which is in my code, but I really don't understand bisection that much and how I get the ranges using bisection . I can do the rest after that point, but the bisection just has me stuck.Spoiler Suppose you want to build a covered box by cutting sections out of a W by H sheet of

cardboard (in meters) and folding as shown in the figure below (cutout the shaded regions

and fold on the dotted lines).

https://dl.dropbox.com/u/28097097/image.jpg [Broken]

Derive an expression for the volume, V , of the box and analytically compute its derivative

as a function of x.

Write a program to find the roots of your derivative and so find the dimension for x (and

by extension y, and z) that maximizes the volume. Your program should read the values

of W and H from standard input after providing an appropriate prompt, find the maximal

volume, then print the maximal volume and the maximizing dimensions x, y, and z. Your

program should automatically determine the allowed range of values for the dimensions given

W and H (note some care is needed when they are equal). Use a constant tolerance of 0:01

meters for the convergence criteria in the bisection.

Basically I'm lost in what am I suppose to set equal to x, so I could get the rest of the equations to work.

**Physics Forums - The Fusion of Science and Community**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Bisection c++ problem

Loading...

Similar Threads - Bisection problem | Date |
---|---|

What's wrong with my bisection method code? | Dec 10, 2017 |

C/++/# Simple bisection program - solved | Apr 12, 2017 |

Runtime error 112 | Oct 17, 2015 |

Bisection formula fortran90/95 | Jun 25, 2015 |

Bisection problem c++ | Nov 24, 2010 |

**Physics Forums - The Fusion of Science and Community**