I was assigned a program where I have to create a MATLAB model for the equation and figure as follows-- https://i.stack.imgur.com/wV0ro.png. Unfortunately, I've been stuck for quite a while.
or dh/dt = (-r^2*sqrt(2*g*h))/(0.5r+htan(phi))^2
where
g=386.4 in/s^2
h = 2+(34/64) in
r = 1/10 in
angle=30.519612098961595 degrees
I calculated for dh/dt, which is -0.185963075319895 in/s and time to empty t=13.611573134321043 s, which I did by t=h/-c1_solution.
My x and y range are:
t1_span = [0 t]
y1_span = [0 ; h]
My function is like this so far:
function hvt1 = leak(r,h,angle, g)
c1_solution_1 = (-(r(y1_span))^2 * sqrt(2*g*h(y1_span))) ;
c1_solution_2 = (0.5*r(t1_span)+h(t1_span)*tand(angle))^2 ;
c1_solution = c1_solution_1(1)/c1_solution_2(1) ;
hvt1 = c1_solution ;
So, this definitely needs work. I'm very inexperienced with this type of thing. I'm wondering how I can model how the container drains as a function of time. I'm guessing I'll have to use ode45. I know how to format ode45 in my program, but I'm having trouble with creating the functions.
Thanks in advance. :)