Tell me what a conformal map is, Python!

Preface

When I was studying for the graduate school entrance exam, I found the concept of "** conformal mapping **" in an electromagnetic textbook. Apparently, it was introduced to solve Laplace's equation of electric potential, but I am not as good at understanding it with the formula as sweet omelet, so I decided to ask Python to teach me. Since it is a heppokomaru in all of math, physics, and Python, please look at it with warm eyes like Dora who sees a baby dinosaur.

table of contents

  1. What is a complex function?
  2. What is a conformal map?
  3. Conformal map in Python
  4. Summary

1. What is a complex function?

First of all, this knowledge was suspicious, so I asked wiki. Complex analysis (wikipedia page) He is famous for talking in the streets, but I hear that he does not get the point. I'm not really sure. I should have learned it

To describe my poor knowledge, a complex function is a field in which points on a two-dimensional plane are represented using ** complex numbers **. I think.

"If you just specify a point on a two-dimensional plane, you can use a vector, but a complex function has the advantage that you can specify one point on the plane by giving one complex number. Instead, like a vector, to three dimensions. I feel like something like "I can't expand it" was written in a book I read a long time ago.

The table of contents is "What is a complex function?", But even if I speak my knowledge poorly, it may be misleading, so I will end here.

2. What is a conformal map?

Since the explanation of the complex function was texto, isn't it a conformal map anyway? Those who thought. It's pretty sharp.

Can you understand conformal mapping without understanding the complex function itself? What is the equiangular angle and how many maps are there? In the first place, the word mapping itself is not common. Hiroyuki also said.

Let's return to the main subject with this area. I think a map is like a machine that does something and returns it when given a value. If you give shochu to the soda server, chu-hi will be returned, and if you give whiskey, highball will be returned. If you don't give anything, soda will be returned. A map is like this soda server. If you do math with a little chord

x=np.array([1,2,3])
y=np.array([1,1,1])
plt.scatter(x,y)
plt.show()

image.png

If you put this uninteresting point on the soda server

def soda_server(x):
    return x**2
x=np.array([1,2,3])
plt.scatter(x,f(x))
plt.show()

image.png

You can see that a point based on a certain law is returned for one point. This is what a map is.

What is isometric? ・ ・ ・ ・ ・ ・ ・ It is written in more detail at the following site.

Conformal map

I explain it 1e10 times more in detail than I do, so please refer to it.

3. Conformal map in Python

Let's do more. Suppose you take a complex number and run it on a soda server. Let's prepare some soda servers first

Well then ** Introducing the crazy members! !! !! ** ** ** Good evening from the world of trigonometric functions What up! !! !! !! ** ** sin!!!

def sin(z):
    return np.sin(z)

** If it's square, leave it to me! !! ** ** z2!!!

def z2(z):
    return  z*z

** Something that often appears in complex function textbook examples! !! ** ** h!!!

def h(z):
    return (z - 1j)/(z + 1j)

Now, I'm wondering how to cook with these guys ...

First, prepare a set of x and y.

import matplotlib.pyplot as plt
import  numpy as np
s = 3
x = np.linspace(-s,s,100)
y = np.linspace(-s,s,100)

Cut the mesh

X,Y=np.meshgrid(x,y)
X=X.flatten()
Y=Y.flatten()

Let's see what it looks like image.png

There are many points. that's all

How do these things change when you pass it through a soda server?

Z=np.zeros([Y.shape[0]],dtype=complex)
for i in range(Y.shape[0]):
    x=X[i]
    y=Y[i]
    z=sin(x+1j*y)
    Z[i]=z

plt.scatter(Z.real,Z.imag,color="red",s=0.8)

image.png

Something has spread.

Next


Z=np.zeros([Y.shape[0]],dtype=complex)
for i in range(Y.shape[0]):
    x=X[i]
    y=Y[i]
    z=z2(x+1j*y)
    Z[i]=z
plt.scatter(Z.real,Z.imag,color="black",s=0.8)
plt.show()

image.png

I wanted to make it look like a lemon, but it was yellow, but it was hard to see, so I made it black.

4. Summary

The dots moved when they were mapped. I had to explain with lines to explain the isometric, but I couldn't understand the code of the link so I tried to rewrite it with points and lost the essence. Image conversion by conformal mapping-Schwarz-Christoffel conversion-part1

Finally, thank you for reading this far. If it is Youtube, it seems that there are many low ratings, but I will update it frequently from now on. Please see again if you like.

Recommended Posts

Tell me what a conformal map is, Python!
What is a python map?
[Python] What is a zip function?
[Python] What is a with statement?
What is python
What is Python
What is a dog? Python installation volume
What is a distribution?
[Python] What is Pipeline ...
What is a terminal?
What is a hacker?
What is a pointer?
[Python] What is virtualenv
Basics of Python learning ~ What is a string literal? ~
What is God? Make a simple chatbot with python
What is a decision tree?
Python list is not a list
[Python] Python and security-① What is Python?
What is a super user?
[Python] * args ** What is kwrgs?
What is a system call
[Definition] What is a framework?
What is a callback function?
Python Basic Course (1 What is Python)
What is Python? What is it used for?
[Python] What is @? (About the decorator)
What is a lexical scope / dynamic scope?
[python] What is the sorted key?
Python for statement ~ What is iterable ~
What is the python underscore (_) for?
Python> What is an extended slice?
[Python] What is pandas Series and DataFrame?
[Python] What is inherited by multiple inheritance?
What to do if there is a decimal in python json .dumps
[Python] What is a formal argument? How to set the initial value
What is NaN? NaN Zoya (Python) (394 days late)
What is the XX file at the root of a popular Python project?
[Introduction to Python] What is the difference between a list and a tuple?
Python learning basics ~ What is type conversion? ~
Map rent information on a map with python
What is "mahjong" in the Python library? ??
What is a dog? Django installation volume
Hash in Perl is a dictionary in Python
What I did with a Python array
I made a Hex map with Python
Try drawing a map with python + cartopy 0.18.0
What is the fastest way to create a reverse dictionary in python?
About February 02, 2020 * This is a Python article.
I tried to explain what a Python generator is for as easily as possible.
I'm new to Python. Could you please tell me where the error is?
[What is an algorithm? Introduction to Search Algorithm] ~ Python ~
Why Python slicing is represented by a colon (:)
What is a dog? Django--Create a custom user model
What is a dog? Challenge Django templates! Volume
Is sys.settrace, a python genius feature, another language?
I tried Python! ] I graduated today from "What is Python! Python!"!
Folium: Visualize data on a map with Python
What are you comparing with Python is and ==?
Launch a shell while a Python script is running
Judge whether it is a prime number [Python]
[Introduction to Udemy Python 3 + Application] 54. What is Docstrings?