1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Coordinate Transformation

  1. Oct 16, 2004 #1

    Clausius2

    User Avatar
    Science Advisor
    Gold Member

    Ok, I have a strong problem. It has to do with programming and concepts of mathematics.

    I have a coordinate transformation:

    [tex] x=x(\xi,\eta)[/tex]
    [tex] y=y(\xi,\eta)[/tex];

    and I want to calculate the metrics coefficients:

    [tex] \xi_x=\frac{\partial \xi}{\partial x}[/tex]
    [tex] \eta_x=\frac{\partial \eta}{\partial x}[/tex]
    [tex] \xi_y=\frac{\partial \xi}{\partial y}[/tex]
    [tex] \eta_y=\frac{\partial \eta}{\partial y}[/tex]

    But I have only the next (I only have the numeric transformation, I don't have any analytical formulae):

    x= a matrix of dimensions [tex] n_{\xi}, n_{\eta}[/tex];
    y= a matrix of dimensions [tex] n_{\xi}, n_{\eta}[/tex];

    [tex] \xi[/tex]= a vector of size [tex]n_{\xi}[/tex]
    [tex] \eta[/tex]= a vector of size [tex]n_{\eta}[/tex]

    Well, I want to compute the metrics coefficients using central diferences. Please, tell me what would you do in order to compute it. I'm goind to show you what i made in Matlab:

    for i=2:nxi-1;
    for j=2:neta-1;

    XI_x(i)=(XI(i+1)-XI(i-1))/(x(i+1,j)-x(i-1,j));
    ETA_x(j)=(ETA(j+1)-ETA(j-1))/(x(i,j+1)-x(i,j-1));
    XI_y(i)=(XI(i+1)-XI(i-1))/(y(i+1,j)-y(i-1,j));
    ETA_y(j)=(ETA(j+1)-ETA(j-1))/(y(i,j+1)-y(i,j-1));

    end
    end

    I'm not sure it works, because I'm not able to imagine the metrics coefficients just acting upon the functions x and y. I don't know If i'm taking correctly the variations in x and y in the denominators.

    Any advice will be greatly appreciated.
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you help with the solution or looking for help too?
Draft saved Draft deleted