function [dev2] = SM_fit_dL_beta(params,data,vars)

z = data(:,1);
V = data(:,2);

V0 = vars(1);
L0 = vars(2);
lambda = vars(3);
alpha = vars(4);
C = vars(5);

dL = params(1);
beta = params(2);

V_fit = zeros(1,length(z))';

for loop = 1:length(z)
    z_inst = z(loop);
    L = L0 + dL + z_inst;
    V_fit(loop) = selmixpower(beta,C,L,lambda,alpha);
end

V_fit = V_fit + V0;

dev2 = sum((V_fit - V).^2);