Having problem with Rankine Oval Matlab

Hi I am having problems with using matlab to find the solution for Rankine Oval in Fluid Mechanics.
>> x=-10:0.01:10;
>> y=0:0.01:10;
>> [x,y]=meshgrid(x,y);
>> m=1;
>> a=1;
>> U=1;
>> psi = U*y - m/(2*pi) * atan(2*a*y./(x.^2 + y.^2 - a^2));
>> contour(x,y,psi,100);
>> grid on;
figure(1)
This is what I have made.... . the problem is I want to find the value when psi equals to zero, but I am not sure. From the book it said I need to use fzero function but it doesn't work.
It would be really nice if you guys help
Thx

1 Comment

Have you taken a look at the following answer?
A little different than your question, but possibly a good reference for the way that you are defining the oval.

Sign in to comment.

 Accepted Answer

The contour function can give you the values for ‘psi’ equal to zero:
cxy = contour(x,y,psi,[0 0]);
That will plot them, and return the (x,y) coordinates in ‘cxy’ as:
x = cxy(1,2:end);
y = cxy(2,2:end);
in the event that you need them for something else.
See the documentation on contour for details.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!