0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

「スカラー場とベクトル場の違いを教えて下さい。」を先生へ。sympyで。

0
Posted at

・私は、素人です。?いつもの楽して覚えたい。

(本日の)ChatGPT先生へ

スカラー場とベクトル場の違いを教えて下さい。

(抜粋)

「場(field)」というのは、
空間の各点に値を対応させるものです。
違いは、
・各点に「数」を与える → スカラー場
・各点に「ベクトル」を与える → ベクトル場
です。
...
両者のつながり
...

(続けて)ChatGPT先生へ

それぞれsympyで教えて下さい。

スカラー場(SymPy)
まずはスカラー場です。
...
全部まとめた完全版

from sympy.vector import *

# =========================
# 座標系
# =========================
C = CoordSys3D('C')

# =========================
# スカラー場
# =========================
T = C.x**2 + C.y**2 + C.z**2

print("スカラー場 T")
print(T)

# =========================
# gradient
# =========================
G = gradient(T)

print()
print("gradient(T)")
print(G)

# =========================
# ベクトル場
# =========================
F = C.x*C.i + C.y*C.j + C.z*C.k

print()
print("ベクトル場 F")
print(F)

# =========================
# divergence
# =========================
D = divergence(F)

print()
print("divergence(F)")
print(D)

# =========================
# curl
# =========================
R = curl(F)

print()
print("curl(F)")
print(R)

結果:

スカラー場 T
C.x**2 + C.y**2 + C.z**2

gradient(T)
2*C.x*C.i + 2*C.y*C.j + 2*C.z*C.k

ベクトル場 F
C.x*C.i + C.y*C.j + C.z*C.k

divergence(F)
3

curl(F)
0

いつもと違うおすすめです。

Qiita内

wikipedia

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?