3D connection of 2D plots
1 view (last 30 days)
Show older comments
hi, I have written a code which shows a 2D circle with 4 lines:
%2D wellbore shape
R=10.795
rb=12
thetab=50
x=-rb:0.1:rb
y=(R^2-x.^2).^(0.5)
plot(x,y)
hold on
y=-(R^2-x.^2).^(0.5)
plot(x,y)
s=((R^2+rb^2-2*R*rb*sin(thetab))^0.5)
thetax=(asind((R*cosd(thetab)/s)));
jj=isreal(thetax)
if jj==1
m1=tand(thetax)
b=-m1*rb
A=(((2*(m1^2)*rb+(4*(m1^4)*(rb^2)-4*(m1^2+1)*((m1^2)*(rb^2)-R^2))^0.5)/(2*(m1^2+1))))
ii=isreal(A)
if ii==1
x=A:rb
y=m1*(x-rb)
plot(x,y)
hold on
y=-m1*(x-rb)
plot(x,y)
x=-rb:-A
y=m1*x+m1*rb
plot(x,y)
hold on
y=-m1*x-m1*rb
plot(x,y)
grid on
end
end
if jj==1
m1=tand(thetax)
b=-m1*rb
A=(((2*(m1^2)*rb+(4*(m1^4)*(rb^2)-4*(m1^2+1)*((m1^2)*(rb^2)-R^2))^0.5)/(2*(m1^2+1))))
ii=isreal(A)
if ii==0
clear('A')
A=0
x=A:rb
y=m1*(x-rb)
plot(x,y)
hold on
y=-m1*(x-rb)
plot(x,y)
x=-rb:-A
y=m1*x+m1*rb
plot(x,y)
hold on
y=-m1*x-m1*rb
plot(x,y)
grid on
end
end
if jj==0
thetax=0
m1=tand(thetax)
b=-m1*rb
A=(((2*(m1^2)*rb+(4*(m1^4)*(rb^2)-4*(m1^2+1)*((m1^2)*(rb^2)-R^2))^0.5)/(2*(m1^2+1))))
ii=isreal(A)
if ii==0
A=0
thetax=0
end
end
but problem is that 'rb' and 'thetab' are (1xn) matrixes and every element of these matrixes shows 'rb' and 'thetab' for a special depth(z). so we should have several circles in different depths(z) in 3D space, and this is not the end! these plots should be connected together to form a 3D surface. like this picture:<<http://www.geoexpro.com/ckfinder/userfiles/images/2008%20-%20Vol%205/No%204/Improving%20Wellbore%20Stability/ultrasonic458.jpeg>>
I should mention that 0<thetab<90 and, R<rb<2*R
who knows how can i do this?
thanks alot,
0 Comments
Answers (0)
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!