Message Boards Message Boards

0
|
5794 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
Attachments:
POSTED BY: SALIOU TELLY
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

I think it would be much easier to keep the map w=f[z] in the complex plane. If you want to invert the map you need to solve for z=f^-1[z] . Mathematica usually can handle it, for example:

In[1]:= Solve[a z + b/z == w, z]

In[2]:= Solve[a (z - z0) + b/(z - z0) == w, z]

Out[2]= {{z -> (w - Sqrt[-4 a b + w^2] + 2 a z0)/(2 a)}, {z -> (
   w + Sqrt[-4 a b + w^2] + 2 a z0)/(2 a)}}
POSTED BY: Kay Herbert
Posted 9 years ago
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

Thanks Kay!

This seems promising as it does appear to be able to solve in the complex form. I will look into the solution in more detail for correctness and also see if I can re-express it in Cartesian form, which is really the ideal form that I would need to work with.

I am more of a Matlab person but I am amazed by the power of Mathematica when it comes to symbolic calculations.....

Thanks again for your time,

Saliou

POSTED BY: SALIOU TELLY
Posted 9 years ago

Good Day Kay,

I explore more into the solutions that Solve provide in my case and quickly realized that it is assuming w and z to be real instead of complex.

By that I mean that Abs[z] in the example you provided is simply treated as the absolute value of the real variable z as opposed to magnitude of the complex variable z. The solution is actually the same if you were to get rid of Abs function.

I have been playing around with Solve and Reduce to figure if one can specify a domain for some of the variables in the equation, but have had some challenges with it.

Below is the complex form of the map that I am actually trying solve:

$$w = \frac{z \left (\left(\frac{\rho z}{\left|z\right|} + s\right)^2+\lambda ^2\right)}{2 \left(\frac{\rho z}{\left|z\right|}+s\right)}$$

Here $\rho$ and $\lambda$ are real but $w$, $z$, and $s$ are all complex with $s$ being just a complex constant parameter (although that should not be relevant). So my interest is in solving for $z$ as function of $w$ and the other constant parameters.

I thought reduce was going to work but it has not yield a solution ... I am checking into its scope and that of Solve to better understand them and would appreciate any suggestion....

Thanks,

Saliou

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