How can I plot a pipe elbow in matlab?

2 views (last 30 days)
David
David on 25 Mar 2014
I am trying to plot a pipe elbow in matlab with toroidal coordinates (r, theta, phi). Where x = 2*cos(phi)+r*cos(theta); y = 2*sin(phi)+r*cos(theta); z = r*cos(theta). r = 0-1; theta = 0-2*pi; phi = 0-pi/2. I was trying to do this with the following code: clear; r=0:1:30; theta=linspace(0,2*pi,30); phi=linspace(0,pi/2,30); [phi,theta]=meshgrid(phi,theta); x=2*cos(phi)+r*cos(theta); y=2*sin(phi)+r*cos(theta); z=r*cos(theta); mesh(x,y,z) view(135,30) axis tight box on xlabel(‘x-axis’) ylabel(‘y-axis’) zlabel(‘z-axis’) Do you have a better code to plot this pipe bend/pipe elbow? From this I will need to do a velocity profile and temperature profile based on the Navier Stokes PDEs. Thanks, David

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!