When i solve this equation, i get a surface with a slant! I dont know what is the problem, can anyone fix it?

My program involves bessel functions in polar coordinates (r,theta). The equation to solve is:
z(r,theta)=(Besselj(1,r)+1.90187*r).cos(theta)
I wrote the folowing code:
[th,r] = meshgrid((0:5:360)*pi/180,0:.05:1);
z=(besselj(1,r)+1.90187.*r).*cos(th);
[X,Y,Z] = pol2cart(th,r,z);
surf(X,Y)
  1. I would like to know whether my program code is correct to sovle the equation and
  2. When i solve it, i get a plot that is slanted. Is there somethingn wrong with my code?
Thanks, any help will be highly appreciated.

Answers (1)

First of all, the radius r in polar coordinates must be non-negative.

1 Comment

I did ofcourse alter the range of values of r from 0:0.05:1, but i get the same slant.

Sign in to comment.

Categories

Find more on Mathematics in Help Center and File Exchange

Asked:

on 4 Sep 2011

Community Treasure Hunt

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

Start Hunting!