--- /dev/null
+#include <iostream>
+#include <cmath>
+#include <cassert>
+#include "mex.h"
+#include <stdlib.h>
+
+#include "slpRectangle.hpp"
+
+#define my_PI 3.141592653589793
+#define EPS 0.02
+
+using namespace std;
+
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+ //sicherheitsabfragen zu Datengroessen
+ if (nrhs != 7)
+ mexErrMsgTxt("expected (x1,x2,y1,y2,d1,d2,d3)");
+ if (nlhs > 2)
+ mexErrMsgTxt("has maximal two output arguments");
+
+
+ plhs[0] = mxCreateDoubleMatrix(1, 1, mxREAL);
+// plhs[1] = mxCreateDoubleMatrix(1, 1, mxREAL);
+
+// plhs[0] = mxCreateDoubleMatrix(1, 2, mxREAL);
+
+
+ //printf("%f,%f,%f,%f",*mxGetPr(prhs[0]),*mxGetPr(prhs[1]),*mxGetPr(prhs[2]),*mxGetPr(prhs[3]));
+
+ //sol = G00(p,y1,y2,x1,x2,l);
+
+ *mxGetPr(plhs[0]) = F_parQY2X2(*mxGetPr(prhs[0]),*mxGetPr(prhs[1]),*mxGetPr(prhs[2]),*mxGetPr(prhs[3]),*mxGetPr(prhs[4]),*mxGetPr(prhs[5]),*mxGetPr(prhs[6]));
+// *mxGetPr(plhs[1]) = FLO_plane(*mxGetPr(prhs[0]),*mxGetPr(prhs[1]),*mxGetPr(prhs[2]),*mxGetPr(prhs[3]),*mxGetPr(prhs[4]),*mxGetPr(prhs[5]),*mxGetPr(prhs[6]));
+
+// printf("%f",FLO_plane(*mxGetPr(prhs[0]),*mxGetPr(prhs[1]),*mxGetPr(prhs[2]),*mxGetPr(prhs[3]),*mxGetPr(prhs[4]),*mxGetPr(prhs[5]),*mxGetPr(prhs[6])));
+
+// *(mxGetPr(plhs[0])+1) = FLO_plane(*mxGetPr(prhs[0]),*mxGetPr(prhs[1]),*mxGetPr(prhs[2]),*mxGetPr(prhs[3]),*mxGetPr(prhs[4]),*mxGetPr(prhs[5]),*mxGetPr(prhs[6]));
+
+
+}
+
+
+
+++ /dev/null
-#include <iostream>
-#include <cmath>
-#include <cassert>
-#include "mex.h"
-#include <stdlib.h>
-
-#include "slpRectangle.hpp"
-
-#define my_PI 3.141592653589793
-#define EPS 0.02
-
-using namespace std;
-
-
-void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
- //sicherheitsabfragen zu Datengroessen
- if (nrhs != 7)
- mexErrMsgTxt("expected (x1,x2,y1,y2,d1,d2,d3)");
- if (nlhs > 2)
- mexErrMsgTxt("has maximal two output arguments");
-
-
- plhs[0] = mxCreateDoubleMatrix(1, 1, mxREAL);
- plhs[1] = mxCreateDoubleMatrix(1, 1, mxREAL);
-
-// plhs[0] = mxCreateDoubleMatrix(1, 2, mxREAL);
-
-
- //printf("%f,%f,%f,%f",*mxGetPr(prhs[0]),*mxGetPr(prhs[1]),*mxGetPr(prhs[2]),*mxGetPr(prhs[3]));
-
- //sol = G00(p,y1,y2,x1,x2,l);
-
- *mxGetPr(plhs[0]) = F_parX1Y2(*mxGetPr(prhs[0]),*mxGetPr(prhs[1]),*mxGetPr(prhs[2]),*mxGetPr(prhs[3]),*mxGetPr(prhs[4]),*mxGetPr(prhs[5]),*mxGetPr(prhs[6]));
- *mxGetPr(plhs[1]) = FLO_plane(*mxGetPr(prhs[0]),*mxGetPr(prhs[1]),*mxGetPr(prhs[2]),*mxGetPr(prhs[3]),*mxGetPr(prhs[4]),*mxGetPr(prhs[5]),*mxGetPr(prhs[6]));
-
-// printf("%f",FLO_plane(*mxGetPr(prhs[0]),*mxGetPr(prhs[1]),*mxGetPr(prhs[2]),*mxGetPr(prhs[3]),*mxGetPr(prhs[4]),*mxGetPr(prhs[5]),*mxGetPr(prhs[6])));
-
-// *(mxGetPr(plhs[0])+1) = FLO_plane(*mxGetPr(prhs[0]),*mxGetPr(prhs[1]),*mxGetPr(prhs[2]),*mxGetPr(prhs[3]),*mxGetPr(prhs[4]),*mxGetPr(prhs[5]),*mxGetPr(prhs[6]));
-
-
-}
-
-
-
--- /dev/null
+#include <iostream>
+#include <cmath>
+#include <cassert>
+#include "mex.h"
+#include <stdlib.h>
+
+#include "slpRectangle.hpp"
+
+#define my_PI 3.141592653589793
+#define EPS 0.02
+
+using namespace std;
+
+
+void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
+ //sicherheitsabfragen zu Datengroessen
+ if (nrhs != 7)
+ mexErrMsgTxt("expected (x1,x2,y1,y2,d1,d2,d3)");
+ if (nlhs > 2)
+ mexErrMsgTxt("has maximal two output arguments");
+
+
+ plhs[0] = mxCreateDoubleMatrix(1, 1, mxREAL);
+// plhs[1] = mxCreateDoubleMatrix(1, 1, mxREAL);
+
+// plhs[0] = mxCreateDoubleMatrix(1, 2, mxREAL);
+
+
+ //printf("%f,%f,%f,%f",*mxGetPr(prhs[0]),*mxGetPr(prhs[1]),*mxGetPr(prhs[2]),*mxGetPr(prhs[3]));
+
+ //sol = G00(p,y1,y2,x1,x2,l);
+
+ *mxGetPr(plhs[0]) = F_parY1Y2_2(*mxGetPr(prhs[0]),*mxGetPr(prhs[1]),*mxGetPr(prhs[2]),*mxGetPr(prhs[3]),*mxGetPr(prhs[4]),*mxGetPr(prhs[5]),*mxGetPr(prhs[6]));
+// *mxGetPr(plhs[1]) = FLO_plane(*mxGetPr(prhs[0]),*mxGetPr(prhs[1]),*mxGetPr(prhs[2]),*mxGetPr(prhs[3]),*mxGetPr(prhs[4]),*mxGetPr(prhs[5]),*mxGetPr(prhs[6]));
+
+// printf("%f",FLO_plane(*mxGetPr(prhs[0]),*mxGetPr(prhs[1]),*mxGetPr(prhs[2]),*mxGetPr(prhs[3]),*mxGetPr(prhs[4]),*mxGetPr(prhs[5]),*mxGetPr(prhs[6])));
+
+// *(mxGetPr(plhs[0])+1) = FLO_plane(*mxGetPr(prhs[0]),*mxGetPr(prhs[1]),*mxGetPr(prhs[2]),*mxGetPr(prhs[3]),*mxGetPr(prhs[4]),*mxGetPr(prhs[5]),*mxGetPr(prhs[6]));
+
+
+}
+
+
+
// }else{\r
\r
tmp2\r
- = apply0Int2(F_parY1Y2_2, fabs(xda), fabs(xdb),\r
+ = apply0Int4(F_parY1Y2_2, fabs(xda), fabs(xdb),\r
fabs(yda), fabs(ydb), d[rxa],\r
d[rxb], d[rx]);\r
// }\r
mex mex_Fpar.cpp slpRectangle.cpp
mex mex_Fort.cpp slpRectangle.cpp
+mex mex_FparY1Y2_2.cpp slpRectangle.cpp
+
mex mex_build_A.cpp slpRectangle.cpp
mex mex_build_As1.cpp slpRectangle.cpp
mex mex_build_As2.cpp slpRectangle.cpp
return sol;\r
}\r
\r
+double F_parQY2X2(double x1, double x2, double y1, double y2, double d1, double d2,\r
+ double d3) {\r
+\r
+ // printf("%.1f %.1f | %.1f %.1f | %.1f %.1f %.1f",x1,x2,y1,y2,d1,d2,d3);\r
+\r
+ double hlp = ((x1 - y1 - d1) * (x1 - y1 - d1) + (x2 - y2 - d2) * (x2 - y2\r
+ - d2) + d3 * d3);\r
+\r
+ double sol = sqrt(hlp);\r
+\r
+ if ((x2 - y2 - d2) != 0)\r
+ sol += (x2 - y2 - d2) * log(sqrt(hlp)-(x2 - y2 - d2));\r
+\r
+ return sol;\r
+}\r
+\r
double F_ort(double x1, double x2, double y2, double y3, double d1, double d2,\r
double d3) {\r
\r
// sol = F_par(x1,x2,y1,y2,d1,d2,d3); Quadratur!!!
double F_parY1Y2_2(double, double, double, double, double, double, double);
+// sol = F_par(x1,x2,y1,y2,d1,d2,d3); Quadratur!!!
+double F_parQY2X2(double, double, double, double, double, double, double);
-/*
// funktionen von Maik
double slpADLO(double, double, double, double, double);
double compute_g0(double, double, double, double);
double FLO_plane(double, double, double, double, double, double, double);
double FLO_perp(double, double, double, double, double, double, double);
-*/
+
// sol = quadInt((F_par/F_ort),a,b,c,d,r,t,u,v,d1,d2,d3);
double applyInt4(
double, double, double, double, double, double, double);
+double calcParIntA(double, double, double, double, double, double, double);
+
+
+
+
+
#endif
\r
in = 0;\r
for i = 1:length(yn)\r
- in = in + yw(i) * xw*f(xn,yn(i));\r
+ for j = 1:length(xn)\r
+ in = in + yw(i) * xw(j)*f(xn(j),yn(i));\r
+ end\r
end\r
\r
end
\ No newline at end of file
function [ret] = test_Fpar(a,b,c,d,r,t,u,v,l1,l2,l3)
-
+%
+% [ret] = test_Fpar(a,b,c,d,r,t,u,v,l1,l2,l3)
quad_sol = surfDoubleQuad(@(x1,x2,y1,y2)1/sqrt((x1-y1-l1).^2+(x2-y2-l2).^2+l3.^2)...
,a,b,c,d,r,t,u,v,5);
+f(a,c,t,v)-f(a,c,t,u)-f(a,c,r,v)+f(a,c,r,u);
- intF2 = @(f,a,b,c,d,r,t,u,v)...
- f(b,d,t,v)-f(a,d,t,v)-f(b,c,t,v)+f(a,c,t,v);
-
- [dm sol] = mex_Fpar(b,d,t,v,l1,l2,l3)
-
- [dm sol1] = mex_Fpar(b,d,0,v,l1,l2,l3)
- sol = sol - sol1;
- [dm sol1] = mex_Fpar(b,d,t,0,l1,l2,l3)
- sol = sol - sol1;
- [dm sol1] = mex_Fpar(b,d,0,0,l1,l2,l3)
- q_sol = sol + sol1;
+ [ mex_Fpar(b,d,t,v,l1,l2,l3) mex_FparY1Y2_2(b,d,t,v,l1,l2,l3);...
+ mex_Fpar(b,d,t,u,l1,l2,l3) mex_FparY1Y2_2(b,d,t,u,l1,l2,l3);...
+ mex_Fpar(b,d,r,v,l1,l2,l3) mex_FparY1Y2_2(b,d,r,v,l1,l2,l3)];
+ [i j] = mex_G00(-0.5, b, d, t + l1, v + l2, l3);
sol = intF(@(x1,x2,y1,y2)mex_Fpar(x1,x2,y1,y2,l1,l2,l3),a,b,c,d,r,t,u,v);
-
- ret = [quad_sol sol q_sol sol/q_sol];
+
+ sol2 = intF(@(x1,x2,y1,y2)mex_FparY1Y2_2(x1,x2,y1,y2,l1,l2,l3),a,b,c,d,r,t,u,v);
+
+ int2 = @(x1,y1,c,d,u,v)...
+ mex_FparQY2X2(x1,d,y1,v,l1,l2,l3)...
+ -mex_FparQY2X2(x1,c,y1,v,l1,l2,l3)...
+ -mex_FparQY2X2(x1,d,y1,u,l1,l2,l3)...
+ +mex_FparQY2X2(x1,c,y1,u,l1,l2,l3);
+
+ sol3 = surfQuad(@(x1,y1)(int2(x1,y1,c,d,u,v)),a,b,r,t,5);
+
+ ret = [quad_sol sol sol2 sol3];
end
function [ret] = test_G00(p, x1, x2,l,a,b,c,d)
-
+%
+% [ret] = test_G00(p, x1, x2,l,a,b,c,d)
quad_sol = surfQuad(@(y1,y2)((x1-y1).^2+(x2-y2).^2+l.^2).^p,a,b,c,d,4);
- [my(1) ] = mex_G00(p,a,c,x1,x2,l);
- [my(2) mq_sol] = mex_G00(p,b,d,x1,x2,l);
- [my(3) ] = mex_G00(p,b,c,x1,x2,l);
- [my(4) ] = mex_G00(p,a,d,x1,x2,l);
+ [my(1) mq(1)] = mex_G00(p,a,c,x1,x2,l)
+ [my(2) mq(2)] = mex_G00(p,b,d,x1,x2,l)
+ [my(3) mq(3)] = mex_G00(p,b,c,x1,x2,l)
+ [my(4) mq(4)] = mex_G00(p,a,d,x1,x2,l)
my_sol = my(1)+my(2)-my(3)-my(4);
+ mq_sol = mq(1)+mq(2)-mq(3)-mq(4);
ret = [quad_sol my_sol mq_sol];
end
f = @(y)((x-y).^2+l.^2).^p;
quad_sol = we*f(no);
-cumsum(f(no))'
+% cumsum(f(no))'
% X = 0:0.2:5;
% Y = ((x-X).^2+l.^2).^p;
%
% plot(X,Y)
-my(1) = mex_g0(p,a,x,l);
-[my(2) mq_sol]= mex_g0(p,b,x,l);
+[my(1) mq(1)] = mex_g0(p,a,x,l);
+[my(2) mq(2)]= mex_g0(p,b,x,l);
my_sol = my(2) - my(1);
+mq_sol = mq(2) - mq(1);