---
title: "How to write an easy to use, interactive physics/science/engineering simulator leveraging ctypes, numba, tkinter and scipy.ndimage + PIL - 黃亭皓"
tags: PyConTW2025, 2025-organize, 2025-共筆
---
# How to write an easy to use, interactive physics/science/engineering simulator leveraging ctypes, numba, tkinter and scipy.ndimage + PIL - 黃亭皓
{%hackmd L_RLmFdeSD--CldirtUhCw %}
<iframe src=https://app.sli.do/event/4F9NDmWykyaQEnY75w2exV height=450 width=100%></iframe>
:::success
本演講提供 AI 翻譯字幕及摘要,請點選這裡前往 >> [PyCon Taiwan AI Notebook](https://pycontw.connyaku.app/?room=nKuX5UzTF3tNaYUumIBJ)
AI translation subtitles and summaries are available for this talk. Click here to access >> [PyCon Taiwan AI Notebook](https://pycontw.connyaku.app/?room=nKuX5UzTF3tNaYUumIBJ)
:::
> Collaborative writing start from below
> 從這裡開始共筆
## physic background
晶體結構與要解決的問題
## simulation
模擬光束打進晶體(?)模擬不同晶面的繞射結果
Classes:
- Beam
- Sample
-
## jit & ctype
要模擬m\*n的空間 利用
- itertools.product
- list comprehension
- numpy norm
已經很有效率
但講者找到文章說 numba jit 和 ctype可以更快
把numba寫的用c寫 包起來用python去call funciton
---
Below is the part that speaker updated the talk/tutorial after speech
講者於演講後有更新或勘誤投影片的部份