Examples:
eq1:=diff(y(t), t) = a*y(t)
s1:=dsolve({eq1, y(0)=100},y(t))
s2:=subs(a=2, s1)
s3:=rhs(s2)
plot(s3, t=0..1)This is what each line of code did:
- Entered ODE into Maple.
-
Used
dsolve
command with initial conditions of y(0)=100, meaning when t=0, the population y=100 to solve the ODE. - Substituted value for to obtain a unique form of the equation.
- Isolated right side.
-
Used the
plot
command to see the exponential growth from 0 to 1.