* Some water pipes in SCCS * a pipe that just allows water to flow agent P = in#'out:P; * a similar, bi-directional pipe segment agent BP = in1#'out2:BP + in2#'out1:BP; * an empty pipe can idle or fill agent EP = in:P' + 1:EP; * and then empty or let water flow agent P' = in#'out:P' + 'out:EP; * those pipes have unit capacity, allowing unit amount of water to flow * in unit time, but its easy to define a fatter pipe * which is not the same as EP | EP agent EP2 = EP[in^2/in,'out^2/'out]; * or define a longer pipe segment that takes longer to fill up agent LEP = (EP[m/out] | EP[m/in])\{in,out}; * The problem with this simple model: a pipe with capacity 2 might have only * unit flow through it. This is brought out when thinking of tee-junctions. * that at least is the basic idea agent T = in#'out1:T + in#'out2:T; * unit outflow from both branches agent TJ = in^2#'out1^2:TJ + in^2#'out2^2:TJ + in^2#'out1#'out2:TJ; * To account for duel capacity pieces of straight pipe. agent EDP = in:DP1 + in^2:DP2 + 1:EDP; agent DP1 = in#'out:DP1 + in^2#'out:DP2 + 'out:EDP; agent DP2 = in#'out^2:DP1 + in^2#'out^2:DP2 + 'out^2:EDP; * then we might tidy up the model to account for an empty tee piece. * empty T may idle or fill agent ET = in:T1 + in^2:T2 + 1:ET; * unit flow may continue either way * or the flow may be stepped up * or the flow may cease agent T1 = in#'out1:T1 + in#'out2:T1 + in^2#'out1:T2 + in^2#'out2:T2 + 'out1:ET + 'out2:ET; * flow may cease rather abruptly * or the flow rate may be lessened or * full flow continues agent T2 = 'out1^2:ET + 'out2^2:ET + in#'out1^2:T1 + in#'out1^2:T1 + in^2#'out1^2:T2 + in^2#'out2^2:T2; * There are variations along those lines ad nauseum, but there is an * interesting feature in the TJ. all other things being equal one would * expect the outflow to be split evenly between the two outputs - but there * is no way to "prefer" this possibility in the defn. of TJ. When connected * to fat pipes we'll see some rather erratic flow, I expect. Why don't you * experiment! * Finally, we can define other usefun components, like valves. agent V = in#'out:V + off:C; agent C = 1:C + on:V; agent EVO = in:VO + off:EVC; agent EVC = 1:EVC + on:EVO; agent VO = in#'out:VO + off#in#'out:EVO; agent S = 'out:S; agent SP = (S[mid/out] | EP)\out;