Results 1 to 3 of 3

Math Help - Paramtrize irregular area in MATLAB.

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

    Paramtrize irregular area in MATLAB.

    Hi,

    Is there a way to parametrize an irregular surface (say in terms of (u,v) such that any point inside the area can be given as p(u,v)? (The boundary is defined by a series of straight line segments which form a closed area)

    I have attached a very simple example of an a boundary. I have already parametrized the boundary in terms of the variable "t" where 0<t<1. I now need to do something similar for the area.

    The reason I am doing this is because I am using MATLAB's optimization toolbox to optimize the connectivity of certain structures inside a particular region. So far I have just used rectangular areas which are simple to work with as all you need to do is set the upper and lower bounds for x and y. I thought if I could map an area to (u,v) I could do something similar for u and v rather than working with cartesian co-ordinates.

    My apologies if this does not belong here, I thouhght this would be my best chance in the hopes that someone else has worked with irregular boundaries in computer programs before.

    Regards Elbarto







    Code for attached figure:
    Code:
    x = [0 5 4 5 1 0]'; y = [0 0 1 2 2 0]';
    
    dx = x(2:length(x))-x(1:length(x)-1);
    dy = y(2:length(x))-y(1:length(x)-1);
    
    LENS = sqrt(dx.^2+dy.^2);
    TOTAL_LEN = sum(LENS);
    dt = LENS/TOTAL_LEN;
    t = [0;cumsum(dt)];
    
    subplot(2,1,1)
    plot(x,y)
    xlabel x
    ylabel y
    title 'Boundary Geometry'
    
    subplot(2,1,2)
    plot(t,x,'-',t,y,'-')
    xlabel t
    legend('x','y')
    title('Parameterized Boundry Position')
    Attached Thumbnails Attached Thumbnails Paramtrize irregular area in MATLAB.-mhf1.jpg  
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by elbarto View Post
    Hi,

    Is there a way to parametrize an irregular surface (say in terms of (u,v) such that any point inside the area can be given as p(u,v)? (The boundary is defined by a series of straight line segments which form a closed area)

    I have attached a very simple example of an a boundary. I have already parametrized the boundary in terms of the variable "t" where 0<t<1. I now need to do something similar for the area.

    The reason I am doing this is because I am using MATLAB's optimization toolbox to optimize the connectivity of certain structures inside a particular region. So far I have just used rectangular areas which are simple to work with as all you need to do is set the upper and lower bounds for x and y. I thought if I could map an area to (u,v) I could do something similar for u and v rather than working with cartesian co-ordinates.

    My apologies if this does not belong here, I thouhght this would be my best chance in the hopes that someone else has worked with irregular boundaries in computer programs before.

    Regards Elbarto







    Code for attached figure:
    Code:
    x = [0 5 4 5 1 0]'; y = [0 0 1 2 2 0]';
     
    dx = x(2:length(x))-x(1:length(x)-1);
    dy = y(2:length(x))-y(1:length(x)-1);
     
    LENS = sqrt(dx.^2+dy.^2);
    TOTAL_LEN = sum(LENS);
    dt = LENS/TOTAL_LEN;
    t = [0;cumsum(dt)];
     
    subplot(2,1,1)
    plot(x,y)
    xlabel x
    ylabel y
    title 'Boundary Geometry'
     
    subplot(2,1,2)
    plot(t,x,'-',t,y,'-')
    xlabel t
    legend('x','y')
    title('Parameterized Boundry Position')
    I'm not sure what you want to do exactly, but look at the help for inpolygon. It is effectivly the characteristic function for a polygon.

    CB
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Member
    Joined
    Mar 2007
    Posts
    206
    Awards
    1
    Thanks CB.

    My problem is this:

    >Define a surface
    >put nodes on the surface
    >move the nodes around the surface (by optimising the x and y cordinates) such that the geomtric potential function is minimized (see attachment for function).

    As you can imagine, defining a rectangular or circular surface (or region) is easy as I can just parramtrize x and y, but what can I do if I want to use an irgular surface?

    inpolygon only tells you if your inside or outside the defined surface which I cannot use because the optimisation constraints require the constraint function to be continous so returning 0 or 1 is not an option.

    Ideally I want a function that defines all possible points on the surface, but I do not know if this is possible for iregular surfaces.


    Regards Elbarto
    Attached Thumbnails Attached Thumbnails Paramtrize irregular area in MATLAB.-butterworth_1984.bmp  
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 1
    Last Post: July 30th 2011, 09:47 PM
  2. Matlab, find area under experimental plot
    Posted in the Math Software Forum
    Replies: 9
    Last Post: October 29th 2009, 06:09 AM
  3. area of an irregular shape from its pixel
    Posted in the Math Software Forum
    Replies: 0
    Last Post: October 2nd 2009, 05:56 AM
  4. Finding the area of irregular figures
    Posted in the Geometry Forum
    Replies: 5
    Last Post: February 6th 2009, 07:06 AM
  5. Finding the area of irregular figures 2
    Posted in the Geometry Forum
    Replies: 1
    Last Post: February 6th 2009, 03:54 AM

Search Tags


/mathhelpforum @mathhelpforum