kill(all)$

maxima : ode flowrate inside room minus flow rate outside room(= CO2),version 1,0
peter.vlaschaert@gmail.com,14/03/2020

start : chemical reaction in the room ,here only a flowrate problem. 
ode   : (o)rdinary (d)ifferential (e)quation.

given : CO2 problem (= relation COVID-19 ,check amount CO2 in the room,after some time)
problem :
----------------------------------------------------------------------------------------------------
The air in the room (volume = 180 m^3),contains 0.15% CO2  initially.
Fresh air contains only 0.05% CO2 ,flows in the room , flowrate 2 m^3/min.
The mixed air flows out with same rate.
-----------------------------------------------------------------------------------------------------
? Find the percentage CO2 as a function time.  (%/time = %/min)

result : given
------------------
flowrate in = flowrate out = 2 m^3/min
P(0)  = 0.15 @ time = (t=0)
P(∞) = ?     @ time = (t=∞)
volume room =180 m^3
density in   = 0.05/volume room
density out = P    /volume room

solve problem :
--------------------

→first step : eliminate m^3

pa1: %/time = %/m^3*m^3/min;/*density*flowrate*/

rem : output related use maxima

→ second step: differential equation model, dP/dt =[%/time], time =min

pa2:'diff(P,t) = in -out;/* first order linear differential equation */

rem : input ,output flowrate model

→ thrid step : in 

pa3: in = 0.05/180*2;

→ fourth step : out

pa4:out=P/180*2;

→ fifth step : list for 

pa5: [pa3,pa4];

→sixth : final model differential equation,use :"pa2"

pa6: subst(pa5,pa2);

pa7:expand(ode2(pa6,P,t)); /* also be solved with separation of variables */

→ find : %c , t=0, P=0.15 ( %/min)

pa8: subst([t=0,P=0.15],pa7);

pa8a:listofvars(pa8);

pa8b:solve(pa8,pa8a);

→ seventh step : P(t)

pa8c:subst(pa8b,pa7);

seventh step: t →∞ ,steadystate: fixed value 

p9:'limit(pa8c,t,inf) =rhs( limit(pa8c,t,inf));

rem : floating value.

float(rhs( limit(pa8c,t,inf)));/* % CO2*/

eight step   : plot of time.

p10:wxplot2d([rhs(pa8c)], [t,0,100])$

t=100, P(100)

p10a:P = float(limit(rhs(pa8c),t,100));

t=10000, P(100)

p10a:P = float(limit(rhs(pa8c),t,10000));

p10:wxplot2d([rhs(pa8c)], [t,0,1000])$

yellow result : Can be removed.
by start : 
ratprint : false