Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
testStraightExp.m
Go to the documentation of this file.
1close all
2clear all
3clc
4
5a=rand(2,1)
6b=rand(2,1);
7t=(b-a)/norm(b-a);
8
9N=50;
10Ax=ones(N,N)*a(1);
11Ay=ones(N,N)*a(2);
12Bx=ones(N,N)*b(1);
13By=ones(N,N)*b(2);
14Tx=ones(N,N)*t(1);
15Ty=ones(N,N)*t(2);
16
17x=[0:N-1]/(N-1);
18y=[0:N-1]/(N-1);
19[X,Y]=meshgrid(x,y);
20
21num=(Bx-X).*Tx+(By-Y).*Ty+sqrt((Bx-X).^2+(By-Y).^2);
22den=(Ax-X).*Tx+(Ay-Y).*Ty+sqrt((Ax-X).^2+(Ay-Y).^2);
23f=log(num./den);
24
26clf
27hold on
28pcolor(X,Y,f)
29plot([a(1) b(1)],[a(2) b(2)],'k')
30axis equal
31
32num1=-(Ax-X).*Tx-(Ay-Y).*Ty+sqrt((Ax-X).^2+(Ay-Y).^2);
33den1=-(Bx-X).*Tx-(By-Y).*Ty+sqrt((Bx-X).^2+(By-Y).^2);
34f1=log(num1./den1);
35
37clf
38hold on
39pcolor(X,Y,f1)
40plot([a(1) b(1)],[a(2) b(2)],'k')
41axis equal
42
43% figure(3)
44% clf
45% hold on
46% surf(X,Y,f-f1)
47% plot([a(1) b(1)],[a(2) b(2)],'k')
48% axis equal
final point of the source segment t
function int_R syms a b c u real f
Definition int_R.m:4
a
Definition int_R.m:14
b
Definition int_R.m:16
x
Definition int_R.m:12
void close(const M &a, const M &b, double tol, const char *msg)
figure(1) clf hold on pcolor(X
f plot([a(1) b(1)],[a(2) b(2)], 'k') axis equal num1
int axis