Results 1 to 4 of 4

Math Help - MATLAB Hyperbolic Paraboloid

  1. #1
    Member
    Joined
    Mar 2007
    Posts
    206
    Awards
    1

    MATLAB Hyperbolic Paraboloid

    Hi,

    I am trying to create a hyperbolic paraboloid much like the one I have below, but instead of having a square region as shown, I would like to have an ellipse (to give an effect similar to the roof shape on the Calgary Olympic stadium).

    My problem is that I have only used the "meshgrid" command in matlab to generate square/rectangular regions so I am unsure how to do this. I think I need to find an appropriate parametrization of an ellipse in order to produce the result I am after. I can see that if I wanted a circle I would use a parametrization of radius and the angle theta but for an ellipse where the radius is not constant I am pretty confused on how to achieve this.

    Any help would be greatly appreciated,

    Regards Elbarto






    Code for images below

    Code:
    %Hyperbolic paraboloid
    x = [-10:.5:10];
    y=[-10:.5:10];
    [X, Y] = meshgrid(x,y);
    Z = X.^2-Y.^2;
    surf(X,Y,Z)
    xlabel x
    ylabel y
    zlabel z
    Attached Thumbnails Attached Thumbnails MATLAB Hyperbolic Paraboloid-hyp_par_01.jpg   MATLAB Hyperbolic Paraboloid-hyp_par_02.jpg  
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Member
    Joined
    May 2006
    Posts
    244
    Quote Originally Posted by elbarto View Post
    Hi,

    I am trying to create a hyperbolic paraboloid much like the one I have below, but instead of having a square region as shown, I would like to have an ellipse (to give an effect similar to the roof shape on the Calgary Olympic stadium).

    My problem is that I have only used the "meshgrid" command in matlab to generate square/rectangular regions so I am unsure how to do this. I think I need to find an appropriate parametrization of an ellipse in order to produce the result I am after. I can see that if I wanted a circle I would use a parametrization of radius and the angle theta but for an ellipse where the radius is not constant I am pretty confused on how to achieve this.

    Any help would be greatly appreciated,

    Regards Elbarto






    Code for images below

    Code:
    %Hyperbolic paraboloid
    x = [-10:.5:10];
    y=[-10:.5:10];
    [X, Y] = meshgrid(x,y);
    Z = X.^2-Y.^2;
    surf(X,Y,Z)
    xlabel x
    ylabel y
    zlabel z
    I'm not sitting at a machine with Matlab at the moment so I don't know if M. works this way but:

    Code:
    dr=0.2;
    r=dr/2:dr:10;
    dtheta=2*pi/20;
    theta=0:dtheta:dtheta*20;
     
    x=kron(r,cos(theta));
    y=kron(r,sin(theta));
     
    [X, Y] = meshgrid(x,y);
    Z = X.^2-Y.^2;
    surf(X,Y,Z)
    .
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Member
    Joined
    Mar 2007
    Posts
    206
    Awards
    1
    Thanks for the reply Constatine11.

    Unfortunately the code you provided also produced a plot over a square domain. Does anyone know if MATLAB is even capable of plotting surfaces over a non square / rectangular domain?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Apr 2009
    Posts
    1

    Wink Non rectangular domain in Matlab

    %================================================= =========================
    %"I am trying to create a hyperbolic paraboloid much like the one I have
    % below, but instead of having a square region as shown, I would like to
    % have an ellipse (to give an effect similar to the roof shape on the
    % Calgary Olympic stadium).
    % My problem is that I have only used the "meshgrid" command in matlab
    % to generate square/rectangular regions so I am unsure how to do this.
    % I think I need to find an appropriate parametrization of an ellipse
    % in order to produce the result I am after. I can see that if I wanted
    % a circle I would use a parametrization of radius and the angle theta
    % but for an ellipse where the radius is not constant I am pretty confused
    % on how to achieve this."
    % Any help would be greatly appreciated,
    %
    % Regards Elbarto
    %
    % ANSWER:
    % Follow the answer to your question!
    % Prof. Diomar Cesar Lobao PhD.
    % www.professores.uff.br/diomar_cesar_lobao
    %================================================= =========================
    %
    clear all; clc; close all;
    %
    %Hyperbolic paraboloid
    figure(1)
    %
    a = 2.0; % major axis
    b = 1.0; % minor axis
    x = [-10:0.015:10];
    y=[-10:0.015:10];
    [X, Y] = meshgrid(x,y);
    Z = X.^2-Y.^2;
    surf(X,Y,Z)
    xlabel x
    ylabel y
    zlabel z
    %
    figure(2)
    %
    %
    [I,J] = find((X.^2/a^2 + Y.^2/b^2) <= 1); % Trick here!!!
    %
    for k=1:size(I,1)
    tmy(I(k),J(k))=X(I(k),J(k));
    tmz(I(k),J(k))=Y(I(k),J(k));
    tmu(I(k),J(k))=(tmy(I(k),J(k))^2 - tmz(I(k),J(k))^2);
    end
    end
    %
    %
    surf(tmy,tmz,tmu);
    %
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. perfect hyperbolic paraboloid cylinder
    Posted in the Calculus Forum
    Replies: 1
    Last Post: September 8th 2010, 01:42 PM
  2. volume of a paraboloid
    Posted in the Calculus Forum
    Replies: 4
    Last Post: October 19th 2008, 02:09 PM
  3. volume of paraboloid
    Posted in the Calculus Forum
    Replies: 2
    Last Post: July 6th 2008, 11:42 PM
  4. Paraboloid Mirror
    Posted in the Pre-Calculus Forum
    Replies: 7
    Last Post: October 30th 2007, 11:33 PM
  5. elliptical paraboloid
    Posted in the Advanced Algebra Forum
    Replies: 0
    Last Post: October 15th 2007, 12:44 PM

Search Tags


/mathhelpforum @mathhelpforum