spayne

37 Reputation

2 Badges

14 years, 104 days

MaplePrimes Activity


These are answers submitted by spayne

thanks Preben. This is a nice approach because it strengthens the math model. It's also the first time I've used a piecewise function in Maple - so that's handy.
I was wrong - that error message was caused by the 'restart' which cleared my definitions for ode1 and ode2. In the end - the following is pretty much what I wanted - but it does look a bit messy (assumes ode1 and ode2 are defined): with(plots); plots:-display(DEplot(ode1, q(t), t = 0 .. 8760, q(t) = 0 .. 10000, [q(0) = 0], title = "contaminant accumulation and dissipation"), DEplot(ode2, q(t), t = 8760 .. 17520, q(t) = 0 .. 10000, [q(8760) = 9278])) So thanks to both you guys.
I tried the other suggestion but got an error. Perhaps DEplots are not "plots"? restart; with(plots); plots:-display(DEplot(ode1, q(t), t = 0 .. 8760, [q(0) = 0], title = "contaminant accumulation in the first year", arrows = none), DEplot(ode2, q(t), t = 0 .. 17520, [q(0) = 17520], title = "contaminant dissipation in second year", arrows = none)); Error, (in plots:-display) expecting plot structure but received: DEplot(ode1, q(t), t = 0 .. 8760, [q(0) = 0], title = "contaminant accumulation in the first year", arrows = none)
Georgios - thank you- the first plot was pretty close to what I wanted. The plot you proposed had the second graph in the first year - but i took your idea and modified the ranges and the initial conditions to give the graph I wanted: restart; with(plots): p1 := dsolve({diff(q(t), t) = 3-3*q(t)/10^4, q(0) = 0}, type = numeric, range = 0 .. 8760): plot1 := odeplot(p1): p2 := dsolve({diff(q(t), t) = -3*q(t)/10^4, q(8760) = 9278}, type = numeric, range = 8760 .. 17520); plot2 := odeplot(p2, color = blue): display(plot1, plot2, title = "contaminant accumulation in the first year(red) and second year(blue)"); I would like the direction field arrows though, so I'm going to try the other suggestion from vuishi as well.
Page 1 of 1