SOLUTION 1SELECTED_OUTPUT 2USER_PUNCH 210 t = SYS("aq", count, name$, type$, moles)20 FOR i = 1 to count30 PUNCH PAD(name$(i), 5) STR_F$(LM(name$(i)),6, 2)40 NEXT i50 END
OH- -6.99 H+ -7.00 H2 -25.15 O2 -42.08
SetCurrentSelectedOutputUserNumber (2)SetOutputStringOn (true)... run simulation ...GetOutputStringLine (1)
SOLUTION 1 Cu 0.1 N(+5) 0.2SELECTED_OUTPUT 1 -reset falseUSER_PUNCH 1 10 t = SYS("aq", count, name$, type$, moles) 20 FOR i = 1 to count 30 PUNCH PAD(name$(i), 8) STR_F$(LM(name$(i)),6 , 4) # _F? und 6?c und sim 2?! 40 NEXT i 50 END -endSELECTED_OUTPUT 2 -reset true -molalities Cu+2 NO3-
iphreeqc=actxserver('IPhreeqcCOM.Object'); % Activate communication with PhreeqCiphreeqc.LoadDatabase('E:\Program Files\USGS\IPhreeqcCOM 3.6.2-15100\database\phreeqc.dat'); % Load databaseIPC_Cell = { 'SOLUTION 1', ... % first solution 'Cu 0.1', ... % moles of Cu2+ cations 'N(+5) 0.2', ... % moles of (NO3)- anions 'SELECTED_OUTPUT 1', ... % main output '-reset false', ... % no further info on calculation 'USER_PUNCH 1',... '10 t = SYS("aq", count, name$, type$, moles)',... '20 FOR i = 1 to count',... '30 PUNCH name$(i) STR_F$(LM(name$(i)),6 , 4)',... '40 NEXT i',... '50 END',... 'SELECTED_OUTPUT 2',... % control output '-reset true',... % complete info on calculation '-molalities Cu+2 NO3-',... % chosen molalities }; IPC_string = sprintf('%s\n', IPC_Cell{:}); % Transform cell array into a multiline stringiphreeqc.OutputStringOn = true; % Load output into string buffer instead of fileiphreeqc.RunString(IPC_string); % Data transfer to IPhreeqC and execution in IPhreeqCiphreeqc.CurrentSelectedOutputUserNumber = 1; % Select SELECTED_OUTPUTOUT_IPC_STRING1 = iphreeqc.GetOutputString; % Possibility 1: get buffered (complete) output stringOUT_IPC_STRING2 = iphreeqc.GetSelectedOutputArray; % Possibility 2: get SELECTED_OUTPUT 1STRING2_corr = OUT_IPC_STRING2(2,1:2:end); % Get only the species names of string2iphreeqc.CurrentSelectedOutputUserNumber = 2; % Select control SELECTED_OUTPUTOUT_IPC_STRING3 = iphreeqc.GetSelectedOutputArray; % Get (manually selected) molalities (+ calculation info)