파이썬
-
2차원 선형 변환 시각화Math♾️/Linear Algebra 2023. 3. 16. 14:55
선형 변환이란 선형 시스템에 임의의 벡터 또는 벡터들의 묶음으로서의 행렬이 입력으로 주어졌을 때의 출력을 얻는 과정이다. 어떠한 선형 시스템이 다음과 같이 주어졌다고 하자. $$A=\begin{pmatrix}2&-1\\ 1&1\end{pmatrix}$$ 이 시스템에 임의의 벡터 $\begin{pmatrix}x\\y \end{pmatrix}$가 입력으로 들어가면 시스템에 의한 선형변환된 결과가 시스템의 열벡터의 결합으로 나타나게 된다. $$\begin{pmatrix}u\\v\end{pmatrix}=\begin{pmatrix}2&-1 \\ 1&1 \end{pmatrix}\begin{pmatrix}x\\y\end{pmatrix}=x\begin{pmatrix}2\\1\end{pmatrix}+y\begin{pma..
-
선형 시스템 파이썬으로 표현하기Math♾️/Linear Algebra 2023. 3. 13. 14:09
아래와 같은 2차 선형시스템을 생각해 보자 $$A\vec{v} = \vec{b}$$ ## numpy와 matplot library import (필요한 라이브러리 import) import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt ## 그래프 polt시 사용할 색 지정 mpl.rcParams['axes.prop_cycle'] = mpl.cycler(color=["#377eb8","#ff7f00", "#4daf4a", "#e41a1c", "#984ea3", "#a65628"]) $$\begin{pmatrix} 2&-1 \\ 1&1 \end{pmatrix} \begin{pmatrix} x\\ y \end{pmatrix} = \..