function [calcabs calcconcs p]=rtl(xr,xp,obsdata,c0,t,pinit)
#	applies a kinetic model and tries to tease out absorbances based on it
	[p,v,nev]=minimize("modres",{pinit,xr,xp,c0,t,obsdata});
	disp("p") #return solution
	p=abs(p);
	disp("fitted p and residual")
	[p' nev]
	calcconcs=model(xr,xp,p,c0,t);
	calcabs=pinv(calcconcs)*obsdata;
endfunction
