AU-BCE-EE / tric-fil-mod

A trickling filter model to simulate air treatment, written in Python
GNU General Public License v3.0
0 stars 0 forks source link

Application with variable inlet concentration #20

Open sashahafner opened 5 months ago

sashahafner commented 5 months ago

This is a problem @AnneMortensen noticed.

sashahafner commented 5 months ago

First suggestion: use this to read data from csv files directly:

pandas.read_csv('experiment_2.1.1.csv', sep = ';')
sashahafner commented 5 months ago

This is what I see in cgin:

image

I guess time (x axis) is in seconds, or anyway is interpreted that way in model call. So you have a very short spike in concentration and then nearly nothing:

>>> cgin
          time      cgin
0     0.000210  0.000004
1     0.000420  0.000004
2     0.000630  0.000011
3     0.000840  0.000004
4     0.001051  0.000000
...        ...       ...
1675  0.352176  0.000038
1676  0.352386  0.000056
1677  0.352596  0.000065
1678  0.352806  0.000060
1679  0.353016  0.000057

These are in g/m3, right? What kind of inlet concentrations are you expecting?

sashahafner commented 5 months ago

Output in pred1 look consistent with these values:

>>> pred1['gas_conc'][nc - 1, :]
array([ 0.00000000e+00, -3.31104798e-14,  4.96515563e-08, -7.28232367e-06,
        1.57052087e-04,  1.58475973e-04,  1.99234715e-05,  2.98022509e-05,
...
        5.67353309e-05,  5.67363831e-05,  5.67374085e-05,  5.67384097e-05])

It looks like the model uses the final concentration beyond the time in the input data concentration:

>>> pred1['gas_conc'][0, :]
array([0.00000000e+00, 5.69748847e-05, 5.69428472e-05, 5.69169890e-05,
       5.68946933e-05, 5.68754651e-05, 5.68588799e-05, 5.68445558e-05,
...
       5.67659961e-05, 5.67659992e-05, 5.67660022e-05, 5.67660049e-05])

Notice that the peak we see in the cgin input is done well before the first time > 0 in the output!

>>> pred1['time']
array([   0.        ,    6.33165829,   12.66331658,   18.99497487,
         25.32663317,   31.65829146,   37.98994975,   44.32160804,
...
sashahafner commented 5 months ago

So, the main problem seems to be that time in input cgin is very short--check for errors there.

AnneMortensen commented 5 months ago

@sashahafner Nicely noticed - I had the time in hours, so I just multiplied with 3600s/h, and now it looks a lot more reasonable. Thank you.