function [y] = function_root_adot(x,a,p,temp,T_g) global R_0 x_mesh counter pa sigma_plastic_vec stress_vec sigma_rubber mechanism_vec T_g_0 stress_profile_vec f_int_vec for s=1:length(x_mesh) R(s) = x_mesh(s); r_R(s) = (1+(a^3-R_0^3)/R(s)^3)^(1/3); eps(s) = 2*log(r_R(s)); eps_dot(s) = (2*a^2*(x))/(R(s)^3)*r_R(s)^(-3); [stress sigma_plastic sigma_rubber1 mechanism] = stress_function_lowmw(T_g_0,temp,T_g,eps_dot(s),eps(s)); % compute dominant stress at mesh point f_int(s) = 2/R(s)*(r_R(s))^(-3)*stress; stress_profile_vec(s) = stress; f_int_vec = f_int; end int_value = trapz(x_mesh,f_int); stress_vec(counter) = stress(1); sigma_plastic_vec(counter) = sigma_plastic(1); sigma_rubber(counter) = sigma_rubber1(1); mechanism_vec(counter) = mechanism(1); y = (p-pa) - int_value; end