Graphing with Mathematica and Parameters

1 reply · 2K views · last reply
Automaton2000
Messages
1
Reaction score
0

Homework Statement



Text problem statement: population model based on the Gompertz equation dP/dt = P(a - b ln P), where a and b are constants, with parts (a) solve for P(t), (b) give P(t) when P(0) = P0 > 0, and (c) describe behavior as t approaches infinity for b > 0 and b < 0.


Second part of Part C is: Use mathematica to draw graphs for a few values of the parameters. [ Consider the cases b > 0 and b< 0]

Homework Equations


I think you use the answer to Part A
Boxed LaTeX-rendered equations: P = e^(a/b) e^(4e^(-bt)), and P = 0.




The Attempt at a Solution


Not sure how to graph with mathematica with parameters
 
You don't, that's why it says "for a few values of the parameters."

So you can use your favorite method to assign the parameters,
varying from the ugly
Code:
a = 1;
b = -1;
A = 6;
Plot[P[t], {t, .., ...}]
or the better
Code:
Block[
 {a = 1, b = -1, A = 6},
 Plot[P[t], {t, .., ...}]
]
to my preferred
Code:
Plot[P[t] /. {a -> 1, b -> -1, A -> 6}, {t, .., ...}]

Using something like
Code:
Plot[P[t] /. {a -> {1, 2, 3, 4}, b -> 1, A -> -2} // Evaluate, {t, 1, 
  6}]
you can even plot multiple ones in the same plot.