function pemodelan_mikrobia_coli_2_fujikawa_umax2 clear clc global umax Nmax q0 N0 Ncoba Nmin tspan umax=0.695709639; %jam^-1 Nmax=10^7.98; %CFU/ml y0_awal=0; %0.005861 y0_akhir=10; N0=10^2.85; %CFU/ml Nmin=(1-(1e-6))*10^2.85; %CFU/ml Ncoba=[10^2.85;10^3.5;10^3.73;10^4.01;10^4.81;10^6.21;10^7.73;10^7.79;10^7.98]; %y(1)= q %y(2)= N m=1; n=1; ytebak=[m;n]; tspan=[0;2;4;6;8;12;16;20;24]; [solution,sse,exitflag,output]=fminsearch(@func_RMSE,ytebak) end function RMSE=func_RMSE(g) global umax Nmax q0 N0 Ncoba tspan [t y]=ode23(@func_ode,tspan,N0,[],g); Nhit=y; Nhit2=[log10(Nhit)]' N02=[log10(Ncoba)]' %mencari R2 SStot=sum((N02-mean(N02)).^2); SSres=sum((N02-Nhit2).^2); R2=1-(SSres./SStot) RMSE=(sum((N02-Nhit2).^2)./length(tspan)).^0.5 % huruf dalam tanda petik kedua menyatakan betuk kurva plot(t,N02,'bo',t,Nhit2,'r-') % huruf dalam tanda petik pertama menyatakan warna kurva end function dN=func_ode(t,N,g) global umax Nmax Nmin m=g(1); n=g(2); dN=umax.*N.*(1-(N./Nmax).^g(1)).*(1-(Nmin./N).^g(2)); end