Message Boards Message Boards

0
|
7395 Views
|
13 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Finding the inverse of a mapping of a disk onto an airfoil

Posted 9 years ago
POSTED BY: SALIOU TELLY
13 Replies

I wonder if you can interpolate the derivatives, instead of derivating the interpolation.

POSTED BY: Gianluca Gorni

If a numerical inverse is enough for you, you can compute the direct transformation in the points in a grid, reverse the order and then use something like ListInterpolation.

POSTED BY: Gianluca Gorni
Posted 9 years ago
POSTED BY: SALIOU TELLY
Posted 9 years ago

Daniel,

Thanks for the suggestion.

Attached is the simplified notebook that I am using....

Regards,

Saliou Telly

Attachments:
POSTED BY: SALIOU TELLY

I made a few small modifications. I did not check which, if any, make a difference to the outcome.

(1) I made all numbers exact. This could be an issue, for example, in "symbolic" handling of square roots.

(2) I converted the equations to expressions.

(3) I did not define x and y to be functions of r and theta. I expect that this makes the reverse solving problem easier. In particular we can now solve for those rather than for the {r,theta} pair.

Ro = 2;
Ri = 1;
\[Rho] = 2;
\[Alpha] = -1/4;
\[Beta] = 0;
\[Lambda] = 7/4;

exprs = {-xd + (Ri*x)/(x^2 + y^2)^(1/2) + ((Ro - Ri)/Ro)*x, 
      -yd + (Ri*y)/(x^2 + y^2)^(1/2) + ((Ro - Ri)/Ro)*y};

Timing[solns = Simplify[Solve[exprs == 0, {x, y}]]]

(* Out[156]= {0.546003, {{x -> (
    2 (xd^3 + xd yd^2 - Sqrt[xd^2 (xd^2 + yd^2)]))/(xd^2 + yd^2), 
   y -> (2 yd (xd^3 + xd yd^2 - Sqrt[xd^2 (xd^2 + yd^2)]))/(
    xd (xd^2 + yd^2))}, {x -> (
    2 (xd^3 + xd yd^2 + Sqrt[xd^2 (xd^2 + yd^2)]))/(xd^2 + yd^2), 
   y -> (2 yd (xd^3 + xd yd^2 + Sqrt[xd^2 (xd^2 + yd^2)]))/(
    xd (xd^2 + yd^2))}}} *)

It might be overwhelming in terms of complexity to do a full symbolic solution of the original pair of equations. Specializing the parameters makes it viable. So you might want to consider having a function that just inverts when given specific values of those parameters.

POSTED BY: Daniel Lichtblau
Posted 9 years ago
POSTED BY: SALIOU TELLY

I doubt it will give a usable result. I transformed to polar because that made the expressions more tractable; this involves also making new variables for sine and cosine, and adding the usual identity to link those algebraically. Found there are four solutions and they are huge. For better control over the process I used GroebnerBasis directly, then used Roots to solve for the radial variable, and back-substituted to get the sine and cosine solution for the angular variable (there is one per radial solution).

e1 = {- xa + 
    1/2*(\[Rho]*xd + \[Alpha]* 
        Sqrt[(xd^2) + (
         yd^2) ] + (\[Lambda]^2*(xd^2 + 
          yd^2)*(\[Rho]*xd + \[Alpha]*  
           Sqrt[(xd^2) + (yd^2) ]))/((\[Rho]* xd + \[Alpha]*  
           Sqrt[(xd^2) + (yd^2) ])^2 + (\[Rho]* yd + \[Beta]* 
           Sqrt[(xd^2) + (yd^2) ])^2)),
   -ya + 1/
     2*(\[Rho]*yd + \[Beta]* 
        Sqrt[(xd^2) + (
         yd^2) ] - (\[Lambda]^2*(xd^2 + 
          yd^2)*(\[Rho]*yd + \[Beta]*  
           Sqrt[(xd^2) + (yd^2) ]))/((\[Rho]* xd + \[Alpha]*  
           Sqrt[(xd^2) + (yd^2) ])^2 + (\[Rho]* yd + \[Beta]* 
           Sqrt[(xd^2) + (yd^2) ])^2))};
e2 = e1 /. {(xd^2 + yd^2) -> r^2, Sqrt[(xd^2) + (yd^2) ] -> r};

e3 = Join[
   Together[
    e2 /. {xd -> r*ctheta, yd -> r*stheta}], {ctheta^2 + stheta^2 - 
     1}];

Timing[gb = 
   GroebnerBasis[e3, {ctheta, stheta, r}, 
    CoefficientDomain -> RationalFunctions];]

(* Out[57]= {2.448772, Null} *)

radii = Solve[gb[[1]] == 0, r, Quartics -> False];
gb2 = Rest[gb] /. radii[[1]];

sin = Solve[gb2[[1]] == 0, stheta];
cos = Solve[gb2[[2]] == 0, ctheta];

As I wrote, this is probably too large to be useful. And there are three others; which is "correct" could vary with parameter values, including the specific values of xa and ya.

In[82]:= radii[[1]]

(* Out[82]= {r -> 
  Root[16 xa^4 \[Alpha]^4 + 32 xa^2 ya^2 \[Alpha]^4 + 
     16 ya^4 \[Alpha]^4 + 32 xa^4 \[Alpha]^2 \[Beta]^2 + 
     64 xa^2 ya^2 \[Alpha]^2 \[Beta]^2 + 
     32 ya^4 \[Alpha]^2 \[Beta]^2 + 16 xa^4 \[Beta]^4 + 
     32 xa^2 ya^2 \[Beta]^4 + 16 ya^4 \[Beta]^4 - 
     16 xa^4 \[Alpha]^2 \[Rho]^2 - 32 xa^2 ya^2 \[Alpha]^2 \[Rho]^2 - 
     16 ya^4 \[Alpha]^2 \[Rho]^2 - 16 xa^4 \[Beta]^2 \[Rho]^2 - 
     32 xa^2 ya^2 \[Beta]^2 \[Rho]^2 - 
     16 ya^4 \[Beta]^2 \[Rho]^2 + (-32 xa^3 \[Alpha]^5 - 
        32 xa ya^2 \[Alpha]^5 - 32 xa^2 ya \[Alpha]^4 \[Beta] - 
        32 ya^3 \[Alpha]^4 \[Beta] - 64 xa^3 \[Alpha]^3 \[Beta]^2 - 
        64 xa ya^2 \[Alpha]^3 \[Beta]^2 - 
        64 xa^2 ya \[Alpha]^2 \[Beta]^3 - 
        64 ya^3 \[Alpha]^2 \[Beta]^3 - 32 xa^3 \[Alpha] \[Beta]^4 - 
        32 xa ya^2 \[Alpha] \[Beta]^4 - 32 xa^2 ya \[Beta]^5 - 
        32 ya^3 \[Beta]^5 - 32 xa^3 \[Alpha]^3 \[Lambda]^2 - 
        32 xa ya^2 \[Alpha]^3 \[Lambda]^2 + 
        32 xa^2 ya \[Alpha]^2 \[Beta] \[Lambda]^2 + 
        32 ya^3 \[Alpha]^2 \[Beta] \[Lambda]^2 - 
        32 xa^3 \[Alpha] \[Beta]^2 \[Lambda]^2 - 
        32 xa ya^2 \[Alpha] \[Beta]^2 \[Lambda]^2 + 
        32 xa^2 ya \[Beta]^3 \[Lambda]^2 + 
        32 ya^3 \[Beta]^3 \[Lambda]^2 + 48 xa^3 \[Alpha]^3 \[Rho]^2 + 
        48 xa ya^2 \[Alpha]^3 \[Rho]^2 + 
        48 xa^2 ya \[Alpha]^2 \[Beta] \[Rho]^2 + 
        48 ya^3 \[Alpha]^2 \[Beta] \[Rho]^2 + 
        48 xa^3 \[Alpha] \[Beta]^2 \[Rho]^2 + 
        48 xa ya^2 \[Alpha] \[Beta]^2 \[Rho]^2 + 
        48 xa^2 ya \[Beta]^3 \[Rho]^2 + 48 ya^3 \[Beta]^3 \[Rho]^2 + 
        16 xa^3 \[Alpha] \[Lambda]^2 \[Rho]^2 + 
        16 xa ya^2 \[Alpha] \[Lambda]^2 \[Rho]^2 - 
        16 xa^2 ya \[Beta] \[Lambda]^2 \[Rho]^2 - 
        16 ya^3 \[Beta] \[Lambda]^2 \[Rho]^2 - 
        16 xa^3 \[Alpha] \[Rho]^4 - 16 xa ya^2 \[Alpha] \[Rho]^4 - 
        16 xa^2 ya \[Beta] \[Rho]^4 - 
        16 ya^3 \[Beta] \[Rho]^4) #1 + (24 xa^2 \[Alpha]^6 + 
        8 ya^2 \[Alpha]^6 + 32 xa ya \[Alpha]^5 \[Beta] + 
        56 xa^2 \[Alpha]^4 \[Beta]^2 + 40 ya^2 \[Alpha]^4 \[Beta]^2 + 
        64 xa ya \[Alpha]^3 \[Beta]^3 + 
        40 xa^2 \[Alpha]^2 \[Beta]^4 + 56 ya^2 \[Alpha]^2 \[Beta]^4 + 
        32 xa ya \[Alpha] \[Beta]^5 + 8 xa^2 \[Beta]^6 + 
        24 ya^2 \[Beta]^6 + 48 xa^2 \[Alpha]^4 \[Lambda]^2 + 
        16 ya^2 \[Alpha]^4 \[Lambda]^2 + 
        32 xa^2 \[Alpha]^2 \[Beta]^2 \[Lambda]^2 - 
        32 ya^2 \[Alpha]^2 \[Beta]^2 \[Lambda]^2 - 
        16 xa^2 \[Beta]^4 \[Lambda]^2 - 
        48 ya^2 \[Beta]^4 \[Lambda]^2 + 
        24 xa^2 \[Alpha]^2 \[Lambda]^4 + 
        8 ya^2 \[Alpha]^2 \[Lambda]^4 - 
        32 xa ya \[Alpha] \[Beta] \[Lambda]^4 + 
        8 xa^2 \[Beta]^2 \[Lambda]^4 + 
        24 ya^2 \[Beta]^2 \[Lambda]^4 - 52 xa^2 \[Alpha]^4 \[Rho]^2 - 
        20 ya^2 \[Alpha]^4 \[Rho]^2 - 
        64 xa ya \[Alpha]^3 \[Beta] \[Rho]^2 - 
        72 xa^2 \[Alpha]^2 \[Beta]^2 \[Rho]^2 - 
        72 ya^2 \[Alpha]^2 \[Beta]^2 \[Rho]^2 - 
        64 xa ya \[Alpha] \[Beta]^3 \[Rho]^2 - 
        20 xa^2 \[Beta]^4 \[Rho]^2 - 52 ya^2 \[Beta]^4 \[Rho]^2 - 
        40 xa^2 \[Alpha]^2 \[Lambda]^2 \[Rho]^2 - 
        8 ya^2 \[Alpha]^2 \[Lambda]^2 \[Rho]^2 + 
        8 xa^2 \[Beta]^2 \[Lambda]^2 \[Rho]^2 + 
        40 ya^2 \[Beta]^2 \[Lambda]^2 \[Rho]^2 - 
        4 xa^2 \[Lambda]^4 \[Rho]^2 - 4 ya^2 \[Lambda]^4 \[Rho]^2 + 
        32 xa^2 \[Alpha]^2 \[Rho]^4 + 16 ya^2 \[Alpha]^2 \[Rho]^4 + 
        32 xa ya \[Alpha] \[Beta] \[Rho]^4 + 
        16 xa^2 \[Beta]^2 \[Rho]^4 + 32 ya^2 \[Beta]^2 \[Rho]^4 + 
        8 xa^2 \[Lambda]^2 \[Rho]^4 - 8 ya^2 \[Lambda]^2 \[Rho]^4 - 
        4 xa^2 \[Rho]^6 - 4 ya^2 \[Rho]^6) #1^2 + (-8 xa \[Alpha]^7 - 
        8 ya \[Alpha]^6 \[Beta] - 24 xa \[Alpha]^5 \[Beta]^2 - 
        24 ya \[Alpha]^4 \[Beta]^3 - 24 xa \[Alpha]^3 \[Beta]^4 - 
        24 ya \[Alpha]^2 \[Beta]^5 - 8 xa \[Alpha] \[Beta]^6 - 
        8 ya \[Beta]^7 - 24 xa \[Alpha]^5 \[Lambda]^2 - 
        8 ya \[Alpha]^4 \[Beta] \[Lambda]^2 - 
        16 xa \[Alpha]^3 \[Beta]^2 \[Lambda]^2 + 
        16 ya \[Alpha]^2 \[Beta]^3 \[Lambda]^2 + 
        8 xa \[Alpha] \[Beta]^4 \[Lambda]^2 + 
        24 ya \[Beta]^5 \[Lambda]^2 - 24 xa \[Alpha]^3 \[Lambda]^4 + 
        8 ya \[Alpha]^2 \[Beta] \[Lambda]^4 + 
        8 xa \[Alpha] \[Beta]^2 \[Lambda]^4 - 
        24 ya \[Beta]^3 \[Lambda]^4 - 8 xa \[Alpha] \[Lambda]^6 + 
        8 ya \[Beta] \[Lambda]^6 + 24 xa \[Alpha]^5 \[Rho]^2 + 
        24 ya \[Alpha]^4 \[Beta] \[Rho]^2 + 
        48 xa \[Alpha]^3 \[Beta]^2 \[Rho]^2 + 
        48 ya \[Alpha]^2 \[Beta]^3 \[Rho]^2 + 
        24 xa \[Alpha] \[Beta]^4 \[Rho]^2 + 
        24 ya \[Beta]^5 \[Rho]^2 + 
        32 xa \[Alpha]^3 \[Lambda]^2 \[Rho]^2 - 
        32 ya \[Beta]^3 \[Lambda]^2 \[Rho]^2 + 
        8 xa \[Alpha] \[Lambda]^4 \[Rho]^2 + 
        8 ya \[Beta] \[Lambda]^4 \[Rho]^2 - 
        24 xa \[Alpha]^3 \[Rho]^4 - 
        24 ya \[Alpha]^2 \[Beta] \[Rho]^4 - 
        24 xa \[Alpha] \[Beta]^2 \[Rho]^4 - 
        24 ya \[Beta]^3 \[Rho]^4 - 
        8 xa \[Alpha] \[Lambda]^2 \[Rho]^4 + 
        8 ya \[Beta] \[Lambda]^2 \[Rho]^4 + 8 xa \[Alpha] \[Rho]^6 + 
        8 ya \[Beta] \[Rho]^6) #1^3 + (\[Alpha]^8 + 
        4 \[Alpha]^6 \[Beta]^2 + 6 \[Alpha]^4 \[Beta]^4 + 
        4 \[Alpha]^2 \[Beta]^6 + \[Beta]^8 + 
        4 \[Alpha]^6 \[Lambda]^2 + 
        4 \[Alpha]^4 \[Beta]^2 \[Lambda]^2 - 
        4 \[Alpha]^2 \[Beta]^4 \[Lambda]^2 - 
        4 \[Beta]^6 \[Lambda]^2 + 6 \[Alpha]^4 \[Lambda]^4 - 
        4 \[Alpha]^2 \[Beta]^2 \[Lambda]^4 + 
        6 \[Beta]^4 \[Lambda]^4 + 4 \[Alpha]^2 \[Lambda]^6 - 
        4 \[Beta]^2 \[Lambda]^6 + \[Lambda]^8 - 
        4 \[Alpha]^6 \[Rho]^2 - 12 \[Alpha]^4 \[Beta]^2 \[Rho]^2 - 
        12 \[Alpha]^2 \[Beta]^4 \[Rho]^2 - 4 \[Beta]^6 \[Rho]^2 - 
        8 \[Alpha]^4 \[Lambda]^2 \[Rho]^2 + 
        8 \[Beta]^4 \[Lambda]^2 \[Rho]^2 - 
        4 \[Alpha]^2 \[Lambda]^4 \[Rho]^2 - 
        4 \[Beta]^2 \[Lambda]^4 \[Rho]^2 + 6 \[Alpha]^4 \[Rho]^4 + 
        12 \[Alpha]^2 \[Beta]^2 \[Rho]^4 + 6 \[Beta]^4 \[Rho]^4 + 
        4 \[Alpha]^2 \[Lambda]^2 \[Rho]^4 - 
        4 \[Beta]^2 \[Lambda]^2 \[Rho]^4 - 2 \[Lambda]^4 \[Rho]^4 - 
        4 \[Alpha]^2 \[Rho]^6 - 
        4 \[Beta]^2 \[Rho]^6 + \[Rho]^8) #1^4 &, 1]} *)
POSTED BY: Daniel Lichtblau
POSTED BY: Kay Herbert
Posted 9 years ago

Thanks Kay!

I will give it a try in the complex domain where it was first derived. However, the map in the complex form (w = f(z)) involved magnitude of z ( |z| ), which you can see in the algebraic form as sqrt (xd^2 + yd^2)... I was not sure would be easily inverted by Mathematica or any other tool.

But it is worth a try and thanks for the suggestion....

Regards,

Saliou

POSTED BY: SALIOU TELLY

All depends, but usually you get an answer if it exists. Example:

In[9]:= Solve[w == (z - z0)/Abs[z] + 1/(z Abs[z]), z]

Out[9]= {{z -> (z0 - Sqrt[-4 - 4 w + z0^2])/(2 (1 + w))}, {z -> (
   z0 + Sqrt[-4 - 4 w + z0^2])/(
   2 (1 + w))}, {z -> (-z0 - Sqrt[-4 + 4 w + z0^2])/(
   2 (-1 + w))}, {z -> (-z0 + Sqrt[-4 + 4 w + z0^2])/(2 (-1 + w))}}

You can also try Reduce

POSTED BY: Kay Herbert
Posted 9 years ago
POSTED BY: SALIOU TELLY
Posted 9 years ago
POSTED BY: SALIOU TELLY

It would be more easy to test this if Mathematica code were provided.

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract