diff --git a/@BearImp/calcCap_puchtler2025.m b/@BearImp/calcCap_puchtler2025.m index 8a73544a5ea080c6166e2f0fac70ac9490974387..21e4efd50cea548a314d8256cb7795510c83ec78 100644 --- a/@BearImp/calcCap_puchtler2025.m +++ b/@BearImp/calcCap_puchtler2025.m @@ -44,12 +44,12 @@ function C_out = calcCap_puchtler2025(s,R_RE,R_R,R_ZL,R_ZR,B,R_L,epsilon_r,alpha if Theta_0l(phi_1) - (a/R_RE+phi_1) > Theta_1l(phi_1) phi_1l = phi_1; else - phi_1l = fzero(@(phi) Theta_0l(phi) - (a/R_RE+phi) - Theta_1l(phi),0); + phi_1l = fzero(@(phi) real(Theta_0l(phi) - (a/R_RE+phi) - Theta_1l(phi)),0); % True value is always real. But on iterations, imaginary solutions might occur, resulting in end if Theta_0r(phi_1) + (a/R_RE+phi_1) < Theta_1r(phi_1) phi_1r = phi_1; else - phi_1r = fzero(@(phi) Theta_0r(phi) + (a/R_RE+phi) - Theta_1r(phi),0); + phi_1r = fzero(@(phi) real(Theta_0r(phi) + (a/R_RE+phi) - Theta_1r(phi)),0); end % fprintf('phi_0 = %d | phi_1l = %d | phi_1r = %d \n',phi_0,phi_1l,phi_1r) end @@ -67,11 +67,11 @@ function C_out = calcCap_puchtler2025(s,R_RE,R_R,R_ZL,R_ZR,B,R_L,epsilon_r,alpha C_grooveL = 2 * 8.854187e-12 * epsilon_r * integral2(fun_groove,0,phi_1,Theta_1l,Theta_0l,'AbsTol',absTol); case 'air' absTol = 50e-4; % 50e-4 corresponds to 0.1 pF with a permittivity of 2.2 - fun_grooveOut = @(phi,theta) R_RE^2.*1./(h_0./epsilon_r + (r_groove(phi,theta)-R_RE-h_0)) .* cos(theta); + fun_grooveOut = @(phi,theta) R_RE^2./(h_0./epsilon_r + (r_groove(phi,theta)-R_RE-h_0)) .* cos(theta); C_grooveRIn = 8.854187e-12 * epsilon_r * integral2(fun_groove ,-phi_1,phi_1r,Theta_0rIn,Theta_1r ,'AbsTol',absTol); C_grooveLIn = 8.854187e-12 * epsilon_r * integral2(fun_groove ,-phi_1,phi_1l,Theta_1l ,Theta_0lIn ,'AbsTol',absTol); - C_grooveROut = 8.854187e-12 * integral2(fun_grooveOut, phi_0,phi_1,Theta_0rOut,Theta_0rIn ,'AbsTol',absTol); - C_grooveLOut = 8.854187e-12 * integral2(fun_grooveOut, phi_0,phi_1,Theta_0lIn ,Theta_0lOut,'AbsTol',absTol); + C_grooveROut = 8.854187e-12 * integral2(fun_grooveOut, phi_0,phi_1,Theta_0rOut,Theta_0rIn ,'AbsTol',absTol*2); + C_grooveLOut = 8.854187e-12 * integral2(fun_grooveOut, phi_0,phi_1,Theta_0lIn ,Theta_0lOut,'AbsTol',absTol*2); C_grooveR = C_grooveRIn + C_grooveROut; C_grooveL = C_grooveLIn + C_grooveLOut; end diff --git a/BearImpOptions.m b/BearImpOptions.m index 0931166f19bbd7b1141d1ea8cb7454a88104d862..266255ccfe1abc91acbf275570d13b470637e4e8 100644 --- a/BearImpOptions.m +++ b/BearImpOptions.m @@ -59,7 +59,7 @@ classdef BearImpOptions < handle & dynamicprops & matlab.mixin.CustomDisplay & m defaultOption.C.outsideArea = 'semianalytisch3D'; defaultOption.C.deformedArea= 'neglect'; defaultOption.C.outlet = 'oil'; - defaultOption.C.r2smallCriterion = 'r<1.00125*R_RE'; + defaultOption.C.r2smallCriterion = 'r<h_0+R_RE'; defaultOption.C.k_vh_factor = 'off'; defaultOption.C.pressureDistribution = 'on'; defaultOption.C.roughnessCorrection = 'off';