Beginners > BASIC functions

USER_GRAPH -active...

(1/1)

Chemistry:
I don't understand that why the graphs are different...

The default of -active identifier is true.

But, if I include the -active identifier in the USER_GRAPH data block, the graph is different from not including the identifier.

Please explain why...

Exclude -active identifier:

--- Code: ---SOLUTION 1
    temp      25
    pH        7
    pe        4
    redox     pe
    units     mmol/kgw
    density   1
    -water    1 # kg

EQUILIBRIUM_PHASES 1
    Calcite   0 10

REACTION 1
    CO2(g)     1
    0.0035 moles in 30 steps

USER_GRAPH 1
    -headings               CO2 equilibrium
    -axis_titles            "CO2 / vol%" "Ca / mM" ""
    -chart_title            "Calcite Equilibrium"
    -axis_scale x_axis      0 3 1 auto
    -axis_scale y_axis      0 3 1 auto
    -initial_solutions      true
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 X = 100 * SR("CO2(g)")
20 Y = 1e3 * TOT("Ca")
30 GRAPH_X X
40 GRAPH_Y Y
  -end

END

SOLUTION 2
    temp      25
    pH        7 charge
    pe        4
    redox     pe
    units     mmol/kgw
    density   1
    Ca        1 Calcite    0
    C(4)      1 CO2(g)     -1.7
    -water    1 # kg

USER_GRAPH 1
    -headings               mixing_line
    -initial_solutions      true
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
40 IF STEP_NO = 0 THEN PLOT_XY 100 * SR("CO2(g)"), 1e3 * TOT("Ca"), symbol = Circle, y-axis = 1, line_width = 1, color = Green
  -end

END


--- End code ---

Include -active identifier

--- Code: ---SOLUTION 1
    temp      25
    pH        7
    pe        4
    redox     pe
    units     mmol/kgw
    density   1
    -water    1 # kg

EQUILIBRIUM_PHASES 1
    Calcite   0 10

REACTION 1
    CO2(g)     1
    0.0035 moles in 30 steps

USER_GRAPH 1
    -headings               CO2 equilibrium
    -axis_titles            "CO2 / vol%" "Ca / mM" ""
    -chart_title            "Calcite Equilibrium"
    -axis_scale x_axis      0 3 1 auto
    -axis_scale y_axis      0 3 1 auto
    -initial_solutions      true
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
10 X = 100 * SR("CO2(g)")
20 Y = 1e3 * TOT("Ca")
30 GRAPH_X X
40 GRAPH_Y Y
  -end
    -active

END

SOLUTION 2
    temp      25
    pH        7 charge
    pe        4
    redox     pe
    units     mmol/kgw
    density   1
    Ca        1 Calcite    0
    C(4)      1 CO2(g)     -1.7
    -water    1 # kg

USER_GRAPH 1
    -headings               mixing_line
    -initial_solutions      true
    -connect_simulations    true
    -plot_concentration_vs  x
  -start
40 IF STEP_NO = 0 THEN PLOT_XY 100 * SR("CO2(g)"), 1e3 * TOT("Ca"), symbol = Circle, y-axis = 1, line_width = 1, color = Green
  -end
    -active

END


--- End code ---

dlparkhurst:
I'm not sure why it was written this way, but I will simply say how it works.

If you define both -active and -connect_simulations, then new points for the curve(s) continue from the previous definition.

If either -active or -connect_simulations is false, then  the new points are plotted on new curve(s).

dlparkhurst:
I should rephrase my reply.

If there was a previous USER_GRAPH block, and you define -active in the current USER_GRAPH block, then: If -connect_simulations is true (whether defined in the current or the previous USER_GRAPH block),  then new points for the curve(s) continue from the previous USER_GRAPH curves. If -connect_simulations is false, then new points are plotted on new curves.

If -active is defined to be false, then no curves are plotted.

Navigation

[0] Message Index

Go to full version