Difference between revisions of "EGR 103/Fall 2014/Lab 11"
Line 1: | Line 1: | ||
+ | == Hints for Problem 4 == | ||
+ | In the differential equation, note that the numerator involves the ratio between your current and maximum population, | ||
+ | <center><math> | ||
+ | \begin{align} | ||
+ | \left(1-\frac{p}{p_{\mbox{max}}}\right) | ||
+ | \end{align} | ||
+ | </math></center> | ||
+ | and not | ||
+ | <center><math> | ||
+ | \begin{align} | ||
+ | \left(\frac{(1-p)}{p_{\mbox{max}}}\right) | ||
+ | \end{align} | ||
+ | </math></center> | ||
+ | |||
== Hints for Problem 5 == | == Hints for Problem 5 == | ||
Since this is a second order differential equation, you will want to use the following: | Since this is a second order differential equation, you will want to use the following: |
Revision as of 13:52, 3 December 2014
Hints for Problem 4
In the differential equation, note that the numerator involves the ratio between your current and maximum population,
and not
Hints for Problem 5
Since this is a second order differential equation, you will want to use the following:
meaning:
To get the derivative of \(y(2)\), you will need to rearrange the equation given in the problem to isolate acceleration. Basically, the equation in the book, in terms of your variables, looks like:
Get an equation for \(\frac{dy(2)}{dt}\) and put that in the second line of your dydt
code.
Also, keep in mind you are tracking both the position and the velocity of the block. That means, among other things, that you need to have two initial conditions (an initial position and an initial velocity) and you need to only plot the first column of the \(yout\) variable that comes out of the ode45
command. Since there are three different damping ratios, you will need to run the ode45
command three different times.