SageMath
SageMath(과거 명칭: Sage 또는 SAGE, "System for Algebra and Geometry Experimentation"[1])는 대수학, 조합론, 그래프 이론, 수치해석, 수론, 미적분학, 통계학 등 수학의 다양한 분야의 기능을 갖춘 컴퓨터 대수학 시스템이다. SageMath의 첫 버전은 2005년 2월 24일 GNU 일반 공중 사용 허가서를 따르는 오픈 소스 자유 소프트웨어로 배포되었다.[2] SageMath는 마그마, 메이플, 매스매티카, MATLAB을 대체하는 오픈 소스 소프트웨어를 개발하는 것을 목적으로 개발되었다. 사용 예제대수 및 미적분x, a, b, c = var('x, a, b, c')
# Note that IPython also supports a faster way to do this, by calling
# this equivalent expression starting with a comma:
# ,var x a b c
log(sqrt(a)).simplify_log() # returns 1/2*log(a)
log(a / b).expand_log() # returns log(a) - log(b)
sin(a + b).simplify_trig() # returns sin(a)*cos(b) + sin(b)*cos(a)
cos(a + b).simplify_trig() # returns -sin(a)*sin(b) + cos(a)*cos(b)
(a + b)^5 # returns (a + b)^5
expand((a + b) ^ 5) # a^5 + 5*a^4*b + 10*a^3*b^2 + 10*a^2*b^3 + 5*a*b^4 + b^5
limit((x ^ 2 + 1) / (2 + x + 3 * x ^ 2), x=Infinity) # returns 1/3
limit(sin(x) / x, x=0) # returns 1
diff(acos(x), x) # returns -1/sqrt(-x^2 + 1)
f = exp(x) * log(x)
f.diff(x, 3) # returns e^x*log(x) + 3*e^x/x - 3*e^x/x^2 + 2*e^x/x^3
solve(a * x ^ 2 + b * x + c, x) # returns [x == -1/2*(b + sqrt(-4*a*c + b^2))/a,
# x == -1/2*(b - sqrt(-4*a*c + b^2))/a]
f = x ^ 2 + 432 / x
solve(f.diff(x) == 0, x) # returns [x == 3*I*sqrt(3) - 3,
# x == -3*I*sqrt(3) - 3, x == 6]
미분 방정식t = var('t') # define a variable t
x = function('x')(t) # define x to be a function of that variable
de = (diff(x, t) + x == 1)
desolve(de, [x, t]) # returns (c + e^t)*e^(-t)
선형 대수A = matrix([[1, 2, 3], [3, 2, 1], [1, 1, 1]])
y = vector([0, -4, -1])
A.solve_right(y) # returns (-2, 1, 0)
A.eigenvalues() # returns [5, 0, -1]
B = matrix([[1, 2, 3], [3, 2, 1], [1, 2, 1]])
B.inverse() # returns
[ 0 1/2 -1/2]
[-1/4 -1/4 1]
[ 1/2 0 -1/2]
# same matrix, but over the ring of doubles (not rationals, as above)
sage: B = matrix(RDF, [[1, 2, 3], [3, 2, 1], [1, 2, 1]])
sage: B.inverse()
[-5.55111512313e-17 0.5 -0.5]
[ -0.25 -0.25 1.0]
[ 0.5 0.0 -0.5]
# The Moore-Penrose pseudo-inverse
sage: C = matrix([[1 , 1], [2 , 2]])
sage: C.pseudoinverse()
[1/10 1/5]
[1/10 1/5]
# Alternatively, call NumPy for the pseudo-inverse
# (only numerical)
import numpy
C = matrix([[1 , 1], [2 , 2]])
matrix(numpy.linalg.pinv(C)) # returns
[0.1 0.2]
[0.1 0.2]
정수론prime_pi(1000000) # returns 78498, the number of primes less than one million
E = EllipticCurve('389a') # construct an elliptic curve from its Cremona label
P, Q = E.gens()
7 * P + Q # returns (24187731458439253/244328192262001 :
# 3778434777075334029261244/3819094217575529893001 : 1)
sage: E2 = EllipticCurve(CC, [0,0,-2,1,1])
sage: E2
Elliptic Curve defined by y^2 + (-2.00000000000000)*y =
x^3 + 1.00000000000000*x + 1.00000000000000 over
Complex Field with 53 bits of precision
sage: E2.j_invariant()
61.7142857142857
가환대수sage: P.<x, y, z> = PolynomialRing(QQ) # polynomial ring in x, y, z over the rationals
sage: (x**3 + y**3 + z**3 - 3*x*y*z).factor()
(x + y + z) * (x^2 - x*y + y^2 - x*z - y*z + z^2)
sage: I = P.ideal(x**2, x*y - y**2) # ideals defined by generators
sage: I.groebner_basis()
[y^3, x^2, x*y - y^2]
같이 보기각주
외부 링크
|
Index:
pl ar de en es fr it arz nl ja pt ceb sv uk vi war zh ru af ast az bg zh-min-nan bn be ca cs cy da et el eo eu fa gl ko hi hr id he ka la lv lt hu mk ms min no nn ce uz kk ro simple sk sl sr sh fi ta tt th tg azb tr ur zh-yue hy my ace als am an hyw ban bjn map-bms ba be-tarask bcl bpy bar bs br cv nv eml hif fo fy ga gd gu hak ha hsb io ig ilo ia ie os is jv kn ht ku ckb ky mrj lb lij li lmo mai mg ml zh-classical mr xmf mzn cdo mn nap new ne frr oc mhr or as pa pnb ps pms nds crh qu sa sah sco sq scn si sd szl su sw tl shn te bug vec vo wa wuu yi yo diq bat-smg zu lad kbd ang smn ab roa-rup frp arc gn av ay bh bi bo bxr cbk-zam co za dag ary se pdc dv dsb myv ext fur gv gag inh ki glk gan guw xal haw rw kbp pam csb kw km kv koi kg gom ks gcr lo lbe ltg lez nia ln jbo lg mt mi tw mwl mdf mnw nqo fj nah na nds-nl nrm nov om pi pag pap pfl pcd krc kaa ksh rm rue sm sat sc trv stq nso sn cu so srn kab roa-tara tet tpi to chr tum tk tyv udm ug vep fiu-vro vls wo xh zea ty ak bm ch ny ee ff got iu ik kl mad cr pih ami pwn pnt dz rmy rn sg st tn ss ti din chy ts kcg ve
Portal di Ensiklopedia Dunia