need help with an differential equation in Matlab

Thread Starter


Joined Sep 18, 2010
Hi guys, im new in matlab world and need some help in solving som problems. They are about differential equation.
1) assume a barrel is being filled with water. Initially, the water runs with the mean flow of 58 liters/min but is decreasing by 1 liter/min^2. we want to know how much water is in the barrel after 25 minutes. Write down the differential equations for this problem. How do the corresponding difference equations look?

2) Adam and sara is playing soccer. Adam kicks the ball straight up at 30m/s. The total acceleration exerted on the ball is a=-g-kv, where g is teh acceleration due to the earth's gravity, and v is the speed of the ball, how long does it take for the ball to reverse its motion? use k=0.1.

For 1) I called the volym of water for y, the flow then become y', and the decreasing velocity flow becomes y''. we have also y(0)=0, y''(0)=58.
and y''=-1.
I wrote y=y+dy, and dy=dy-1. But couldn't how the continue since we have a second order differential equation, but at the same time y'' is constant.

For 2) i wrote

can anyone help me please