CODE???? what code. This is calculus. You can calculate a mathematical approximation, but until you write out the derivatives you can't start.
What edcentric is saying is that you are having difficulty in two different areas. The matlab code to do this is fairly trivial - you'll get the hang of it quickly. However, you seem to be having trouble recognizing how to do the problem even outside of matlab. This is probably the simplest ODE that you'll find, and if you're having trouble with it, you need to read the book a little more or pay more attention in class. I mean, what are you going to do when you have a cone dripping into a cube, and the height of the water in the cone is decreasing by x cm/s and the question is how fast is the water in the cube rising.
This is just a basic level course. This is the hardest assignment we will have to do.
If anyone is still looking at this, do you know how you would set up a more general function based off the other one that would accept a list of hole positions? I tried to set it up like this ...
F = -0.1; %flow rate from 1 cm of water
if h > holes
hprime = F*(h-holes) + F*h; %it goes out through 2 holes
else
hprime = F*h; %it goes out through one hole
end
but realized that can't be right bc that only accounts for 2 holes when there could be any number of holes....
Comments
i think there is something wrong with the last part though because when i graph it it levels off at 2.5 and it should go down to 0 right?
What edcentric is saying is that you are having difficulty in two different areas. The matlab code to do this is fairly trivial - you'll get the hang of it quickly. However, you seem to be having trouble recognizing how to do the problem even outside of matlab. This is probably the simplest ODE that you'll find, and if you're having trouble with it, you need to read the book a little more or pay more attention in class. I mean, what are you going to do when you have a cone dripping into a cube, and the height of the water in the cone is decreasing by x cm/s and the question is how fast is the water in the cube rising.
If anyone is still looking at this, do you know how you would set up a more general function based off the other one that would accept a list of hole positions? I tried to set it up like this ...
F = -0.1; %flow rate from 1 cm of water
if h > holes
hprime = F*(h-holes) + F*h; %it goes out through 2 holes
else
hprime = F*h; %it goes out through one hole
end
but realized that can't be right bc that only accounts for 2 holes when there could be any number of holes....