Solving Differential Equations of Motion
Motivation
We have already discussed the solution to the differential equations that describe an object falling subject to a constant gravitational force both with and without air drag in the earlier sections of this chapter. I now wish to discuss solving such equations with the other velocity-dependent forces that we have discussed for vehicles, as well as some other examples.
I hope you get the idea after seeing a few examples, that it's really no big deal and that we can solve all kinds of very complex motions that one couldn't even dream of solving using paper and pencil by using GeoGebra and the numerical differential equation solver.
Of course it is not GeoGebra alone that can solve such systems of equations. Any capable scientific computing platform has this ability, and if you understand some basic principles of numerical methods and the associated algorithms, you can rather easily write your own programs in any computer language to solve such systems of equations.
A Single-Stage Toy Rocket
Since we already discussed a system subject to constant gravity and drag, with a minimal addition of a constant thrust force we can model something like a toy rocket or a firework. So before getting to vehicle problems, consider this scenario: A toy rocket or firework of mass 0.100kg with a radius of 1.0cm and a drag coefficient of 0.25 is shot directly upward and has a thrust of 2.0N that lasts 4.0s before it burns out and suddenly stops producing thrust.
An aside: Real rockets often exhibit a similar behavior to our constant force, but after one "stage" burns out another begins - usually with a longer lasting, but lower thrust force. There are often several stages. The other thing that happens in real rockets is that the fuel (or propellant) that’s ignited and ejected out the rocket is causing a rapid and significant mass loss for the remaining rocket. This is also true of a firework, but we will not include the time-dependent mass. Just in case you’re wondering about it, the rate of propellant mass loss dm/dt times the speed at which the propellant is being ejected gives the thrust force… so they are related.
Let's see if we can find the rocket's maximum height attained, the maximum speed it reaches, and perhaps the time it will take to make it back to the ground after falling. All of those answers will be contained in the position versus time and velocity versus time plots. I will assume now that the upward direction is positive x. The forces (assumed 1D along the vertical axis) look like this:
Conditional equations like the first one are entered into GeoGebra like this:
F_{T,x}(t) = If[0 <= t <= 4, 2, 0].
The last entry is the value of the function in the "otherwise" condition. For more information on entering conditional functions in GeoGebra, see the documentation or this link. So to solve the motion for this system all we really do is add one more term to the ball falling with air drag. Find the net force, divide by mass to get acceleration. These equations are just the sum of the ones listed above, so
Given the acceleration, to solve for the motion, the equations we need to enter are:
r_x'(t,r_x,v_x)=v_x v_x'(t,r_x,v_x)=-g-k/m*abs(v_x)*v_x+F_{T,x}(t)/m NSolveODE[{r_x',v_x'},0,{0,0},10].
The last entry in the last function is the total time of flight to calculate. If you find you need more time to reach the ground, then change it. Obviously the value of 'k' is dependent on the air density, drag coefficient and frontal area. So which must be solved using parameters given in the problem statement. This gives a value of Also notice that if the thrust force or any other force depends on some parameter (time in this case), that the function must be entered showing that dependence in regular parenthes like this:F_{T,x}(t).
Don't forget that the underscore and first set of brackets are just the subscript. The results of the calculation for the rocket's motion are seen below. I made the thrust and duration of thrust adjustable just for fun.Rocket Problem Solved
As you can see from the results above, the answers to our questions are simple to obtain. By placing a point on each curve - the position curve and the velocity curve, we can find that rounded to 3 significant figures (for no particular reason), we find the max height is 152m at 7.76s, and the max speed is 38.0m/s at 4.09s. The rocket falls back and reaches the ground at somewhere over 13s, but I will let you move the point to see exactly how long it takes. Try changing the sliders too and see how the answers change.
An Electric Car Example
Consider an electric car that has only one gear. While that'd be crazy for a gasoline engine, it would work fine with an electric vehicle. In fact, the Tesla Model S has only one gear. The reason it works with electric vehicles is that they generate maximum force from rest, so a gear that would seem really hard to get started - like starting a manual transmission in 3rd or 4th gear in a gasoline engine - is easy for an electric motor to start because of its tremendous stall force and torque.
Suppose that a new, light weight electric car has the following properties:
mass = 1000kg frontal area= 2.0m2 cd=0.25 crr0=0.01 crr1=0.00015 cb=0 (ignore it) Force vs. speed function for the electric motor is F(v)=5000-60v.
Can you see what the stall force and no-load speed are for this motor? If not, please look back at electric motor force curves and figure it out. If you plot this function it'll be helpful. We'll see that the no-load speed is not going to define the top speed for this car. No-load means the motor has nothing resisting it. Going down the road there will be drag and rolling resistance, so the top speed will be less than the no-load speed for sure! To find the results we only need to sum up the forces of the motor given above, the air drag in the usual form, and the rolling resistance force. Since it's small, I am ignoring the bearing resistance in this example. In GeoGebra, once the constants and the motor force are defined, the only needed equations are:r'(t,r,v)=v v'(t,r,v)=(F(v)-1/2*1.21*A*cd*abs(v)*v-m*g*(crr0+crr1*v))/m NSolveODE[{r',v'},0,{0,0},60]
The last statement gives the car up to 60s to run, which might technically not be long enough to reach top speed. The position versus time and velocity versus time are worked out below. Questions that are meaningful to car enthusiasts are: How long does it take to go 0-60mph? How long does it require to cover the quarter mile? What is its top speed? We can see below what these answers are so long as we convert 60mph = 26.8m/s, 1/4 mile=402m, and realize that the top speed on the graph must be multiplied by roughly 2.2 to make it mph rather than m/s. Have a look and see what the answers are.Electric Car Performance Plots
It looks to me like 60mph is reached in 6.8s, the quarter mile is covered in 15.0s, and the top speed is around 61m/s = 134mph. To be sure about the top speed (asymptote), I'd probably run the calculation for a bit longer...maybe 100s or so. See if you can find the quarter mile trap speed, or the speed at which the car was traveling as it crossed the finish line of a quarter mile race. What about 0-100 mph time. Mess around with it until you get comfortable answering such questions.