Question
Matlab Code for Error Analysis For function fx,t) x/t use Matlab to find the estimation error (assuming the first order taylor expression ) at x 4-0.002 and t 2+-0.001 %Open New file and save it on known source folder % Matlab code syms x t The total error is then expressed as: Dx-0.002 Dt 0,001; dydx diff(y,x) dydt diff(y,x) Err abs(dydx) Dx +abs(dydt) Dt; F subs(y,(x,t),14,2)); DF subs(Err,(xt),14,2)); DF xpr ro
Explanation / Answer
function [c_t,c_t_noise] =Noise_ConstrainedK2(t,a1,a2,a3,b1,b2,b3,td,tmax,k1,k2,k3) K_1 = (k1*k2)/(k2+k3); K_2 = (k1*k3)/(k2+k3); %DV_free= k1/(k2+k3); c_t = zeros(size(t)); ind = (t > td) & (t = tmax); c_t(ind)=conv((a1 * exp(-b1 * (t(ind) - tmax))+ a2 * exp(-b2 * (t(ind) - tmax))) + a3 * exp(-b3 * (t(ind) - tmax)),(K_1*exp(-(k2+k3)*t(ind)+K_2)),'same'); for mean=1:10 for sigma=1:45 c_t_noise = c_t+normrnd(mean,sigma,[1 500],length(c_t)); end end dg = [0 0.5 0]; plot(t,c_t,'r'); hold on; plot(t,c_t_noise,'Color',dg); hold off; axis([0 50 0 1900]); xlabel('Time[mins]'); ylabel('concentration [Mbq]'); title('My signal'); end