You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
今回は Python(SymPy)を活用する具体例として、4次元時空のSchwarzschild(シュワルツシルト)解がアインシュタイン方程式の解になっていることをPython(SymPy)を使って確認してみたいと思います。シュワルツシルト解は静的で球対称な場合のアインシュタイン方程式の真空解として求められます。 一般に、アインシュタイン方程式は時空の計量テンソルを偏微分してクリストッフェル記号、それを複雑に組み合わせた曲率テンソルを計算しないといけません。今回計算するような静的で球対称な場合には、仮定する変数依存性が少ないので手計算でもなんとかなるかもしれませんが、計算過程で求めなければいけない量が多く、そういった面倒な計算にはコンピュータを使ってラクをするのが良いでしょう。PythonのSymPyは、そのようなことを可能にする数式処理ライブラリです。 次の記事の中ではPython(Sy
SymPy Plotting Backends で電場ベクトルの方向場を描く Filed under SymPy & SPB, 電磁気学 2023年10月30日 正負の点電荷がつくる電場$\boldsymbol{r}_1$ にある正電荷 $q\ (>0)$ と,$\boldsymbol{r}_2$ にある負電荷 $-q$ がつくる電場ベクトル $\boldsymbol{E}$ は \begin{eqnarray} \boldsymbol{E} &=& \frac{q}{4\pi \varepsilon_0} \frac{\boldsymbol{r} – \boldsymbol{r}_1}{|\boldsymbol{r} – \boldsymbol{r}_1|^3} – \frac{q}{4\pi \varepsilon_0} \frac{\boldsymbol{r} – \boldsymb
この記事の続きです。 ここではPRMLの10.1.3項の一変数ガウス分布の例題(WikipediaのVariational_Bayesian_methodsのA basic exampleと同じ)をSymPyで解きます。すなわちデータが に従い*1、とが、 に従うという状況です。ここでデータ()が得られたとして事後分布を変分ベイズで求めます。 まずはじめに、上記の確率モデルから同時分布を書き下しておきます。 なので、 となります。 この問題は単純なので事後分布は厳密に求まるのですが、ここでは変分ベイズで解きます。すなわち、事後分布をで近似します。さらにと因子分解可能と仮定します。そして、前の記事の最後の2つの式を使って、とが収束するまで繰り返し交互に更新して求めるのでした。以下ではこれをSymPyでやります。 from sympy import * from sympy.stats imp
Symbolic math with juliaIntroductionThe julia language bills itself as "fresh approach to technical computing." By saying "fresh" the implication is that there exists many older approaches to technical computing. Indeed there are. For mathematical areas there are three different philosophies for computing: symbolic, numeric, and general purpose. The symbolic approach is the domain of Computer Alge
No one is good at everything, that’s why we have society. No project is good at everything, that’s why we have interfaces. This is the first of three posts that join SymPy, a library for symbolic mathematics, and Theano, a library for mathematical compilation to numeric code. Each library does a few things really well. Each library also over-reaches bit and does a few things not-as-well. Fortunate
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く