Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Multiple Plots' topicStudent Support Forum > General > Archives > "Multiple Plots"

Help | Reply To Topic
Author Comment/Response
Timmy
09/21/10 11:20pm

I would like to make multiple plots (possibly an array) for each of the dependent variables in the following code. I've been trying multiple different strategies but I keep breaking the code. Is there any elegant way for the plots to be separate instead of the same plot? Thank you for your time.

consumption[x_, y_, z_] := y*x/(z + x)
load[t_] := E^t
Manipulate[Plot[Evaluate[{AT[x], AS[x], AF[x]} /. First[NDSolve[ {
(*Ammonia*)
AT'[t] ==
load[t] + flow*(AF[t]/V3 - AT[t]/V1) -
consumption[AT[t], P1, P2]*b1T[t],
AS'[t] ==
flow*(AT[t]/V1 - AS[t]/V2) - consumption[AS[t], P3, P4]*b1S[t],
AF'[t] ==
flow*(AS[t]/V2 - AF[t]/V3) - consumption[AF[t], P5, P6]*b1F[t],
(*Nitrite*)
BT'[t] ==
flow*(BF[t]/V3 - BT[t]/V1) +
consumption[AT[t], P1, P2]*b1T[t] -
consumption[BT[t], P7, P8]*b2T[t],
BS'[t] ==
flow*(BT[t]/V1 - BS[t]/V2) +
consumption[AS[t], P3, P4]*b1S[t] -
consumption[BS[t], P9, P10]*b2S[t],
BF'[t] ==
flow*(BS[t]/V2 - BF[t]/V3) +
consumption[AF[t], P5, P6]*b1F[t] -
consumption[BF[t], P11, P12]*b2F[t],
(*Nitrate*)
CT'[t] ==
flow*(CF[t]/V3 - CT[t]/V1) + consumption[BT[t], P7, P8]*b2T[t],
CS'[t] ==
flow*(CT[t]/V1 - CS[t]/V2) +
consumption[BS[t], P9, P10]*b2S[t],
CF'[t] ==
flow*(CS[t]/V2 - CF[t]/V3) +
consumption[BF[t], P11, P12]*b2F[t],
(*Bacteria*)
b1T'[t] == -d1*b1T[t] + r1*consumption[AT[t], P1, P2]*b1T[t],
b1S'[t] == -d1*b1S[t] + r1*consumption[AS[t], P3, P4]*b1S[t],
b1F'[t] == -d1*b1F[t] + r1*consumption[AF[t], P5, P6]*b1F[t],
b2T'[t] == -d2*b2T[t] + r2*consumption[BT[t], P7, P8]*b2T[t],
b2S'[t] == -d2*b2S[t] + r2*consumption[BS[t], P9, P10]*b2S[t],
b2F'[t] == -d2*b2F[t] + r2*consumption[BF[t], P11, P12]*b2F[t],
(*Initialization*)
AT[0] == ATinit,
AS[0] == ASinit,
AF[0] == AFinit,
BT[0] == BTinit,
BS[0] == BSinit,
BF[0] == BFinit,
CT[0] == CTinit,
CS[0] == CSinit,
CF[0] == CFinit,
b1T[0] == b1Tinit,
b1S[0] == b1Sinit,
b1F[0] == b1Finit,
b2T[0] == b2Tinit,
b2S[0] == b2Sinit,
b2F[0] == b2Finit
},
{
AT, AS, AF, BT, BS, BF, CT, CS, CF, b1T, b1S, b1F, b2T, b2S, b2F
},
{t, 0, tmax}]]], {x, 0, tmax}],
{{tmax, 4}},
{{ATinit, 1}, 0, 3},
{{ASinit, 1}, 0, 3},
{{AFinit, 1}, 0, 3},
{{BTinit, 1}, 0, 3},
{{BSinit, 1}, 0, 3},
{{BFinit, 1}, 0, 3},
{{CTinit, 1}, 0, 3},
{{CSinit, 1}, 0, 3},
{{CFinit, 1}, 0, 3},
{{b1Tinit, 1}, 0, 3},
{{b1Sinit, 1}, 0, 3},
{{b1Finit, 1}, 0, 3},
{{b2Tinit, 1}, 0, 3},
{{b2Finit, 1}, 0, 3},
{{b2Sinit, 1}, 0, 3},
{{flow, 100}, 0, 200},
{{V1, 100}, .001, 200},
{{V2, 100}, .001, 200},
{{V3, 100}, .001, 200},
{{P1, 1}, 0, 3},
{{P2, 1}, 0, 3},
{{P3, 1}, 0, 3},
{{P4, 1}, 0, 3},
{{P5, 1}, 0, 3},
{{P6, 1}, 0, 3},
{{P7, 1}, 0, 3},
{{P8, 1}, 0, 3},
{{P9, 1}, 0, 3},
{{P10, 1}, 0, 3},
{{P11, 1}, 0, 3},
{{P12, 1}, 0, 3},
{{d1, 1}, 0, 3},
{{d2, 1}, 0, 3},
{{r1, 1}, 0, 3},
{{r2, 1}, 0, 3}
]




URL: ,
Help | Reply To Topic