Демонстрация на основни функционалности на Mathematica

Декларация на променливи

a=4
b=3;
c=a+b;
d="Текст"
е={1,2,3}

Clear[a,b,c,d,e]

Списъци, работа със списъци

a={1,2,3,4,5,6,7,8,9,10};
b={{1,2},{3,4}};
c={{1},2,{3,4},{{5},{3}}};
d={π,E,θ};

a[[1]]
Part[a,1]
{a[[1]],a[[3]],a[[5]]}
a[[1;;10;;2]]

b[[1]]
b[[2]]
b[[1,2]]
c[[1]]
c[[4,1]]

m=d[[1]]+d[[2]]+d[[3]]
N[m]

a+1
a*2
a+a
b^2

Flatten[c,1]
Flatten[c,2]
Flatten[c]

Clear[a,b,c,d,m];

Графики

Plot[Sin[x],{x,0,2π}]
Plot[{Sin[x],Sin[2x],Sin[3x],Sin[4x]},{x,0,2π}]

spisykOTtochki={{0,1},{1,2},{2,2},{3,2},{4,3},{5,4}};
ListPlot[spisykOTtochki]
ListPlot[spisykOTtochki,Joined->True]

R=3;
ParametricPlot[{R Cos[y],R Sin[y]},{y,0,2π}]
ParametricPlot[{R/3 y Cos[y],R/3 y Sin[y] },{y,0,6π}]

ParametricPlot3D[{ y Cos[3y], y Sin[3y], y/2},{y,0,3}]
ParametricPlot3D[{ (1+(1/2)v Cos[(u/2)])Cos[u],(1+(1/2)v Cos[(u/2)])Sin[u],(1/2)v Sin[(u/2)]},{v,-1,1},{u,0,2π}]
ParametricPlot3D[{  Cos[y]Sin[x], Cos[y]Cos[x], Sin[y]},{y,-π/2,π/2},{x,0,2π}]

Plot3D[x+y,{x,0,3},{y,0,3}]
Plot3D[{4Sin[x]Sin[y],x+y},{x,0,3},{y,0,3}]
Plot3D[{x+(y^2),x+2(y^2),x+3(y^2),x+4(y^2)},{x,-3,3},{y,-3,3}]

Матрици и работа с тях

А={{1,0},{0,1}};
B={4};
c={{3,1,2},{2,1,1},{0,5,3}};
e={{1,0,1},{1,1,-1},{2,1,0}};
d={{1,1,0,1},{-1,0,1,0},{1,1,2,3},{0,0,1,3}};

A//MatrixForm
B//MatrixForm
e//MatrixForm
c//MatrixForm
d//MatrixForm
d[[1]]
Transpose@d // MatrixForm
(Transpose@d)[[1]]

c.e // MatrixForm
g=f^3;
A1=A.A;
MatrixForm[g]
MatrixForm[A1]

Det[A]
Det[B]
Det[c]
Det[d]

Eigenvalues[A]
Eigenvectors[A]

MatrixForm@Transpose@A

Eigenvalues[e]
Eigenvectors[e]
M=JordanDecomposition[e];
M[[2]] // MatrixForm

CharacteristicPolynomial[d,λ]

Table, ReplaceAll, Expand

n=10;
t=Table[ i, {i,1,n}]
tt=Table[i,{i,1,n,0.5}]
ttt=Table[(i/(i+1)),{i,1,n}]
q=Table[i+j,{i,1,3},{j,1,3}];
q//MatrixForm

Clear[x]
P=x^2+y^2+3x +y-1+(E^x)
Q=P/. x->z
Q1=Q/. z->1

t /. z_-> z+1
t/. List->Plus
t/. List-> Times