Sustavy rovnic

A={{1,2},{-1,3}}

MatrixForm[A]

Det[A]

RowReduce[A]//MatrixForm

MatrixRank[A]

NullSpace[A]

b={1,2}

r=LinearSolve[A,b]

A.r

priamky=ContourPlot[{x+2 y==1,-x+3 y==2},{x,-5,5},{y,-5,5},AspectRatio->Automatic,ContourStyle->{RGBColor[1,0,0],RGBColor[0,1,0]},Frame->False,Axes->True]

bod=Graphics[{AbsolutePointSize[10],RGBColor[0,0,1],Point[r]}]

Show[priamky,bod]

(B={{1,2},{2,4}})//MatrixForm

b={1,2}

r=LinearSolve[B,b]

B.r

priamky=ContourPlot[{x+2 y==1,2 x+4 y==2},{x,-5,5},{y,-5,5},AspectRatio->Automatic,ContourStyle->{RGBColor[1,0,0],RGBColor[0,1,0]},Frame->False,Axes->True]

Plot[(1-x)/2,{x,-5,5},AspectRatio->Automatic,PlotStyle->RGBColor[1,0,0]]

Clear[x,y]
B.{x,y}

rovnice={(B.{x,y})[[1]]==b[[1]],(B.{x,y})[[2]]==b[[2]]}

priamky=ContourPlot[Evaluate[rovnice],{x,-5,5},{y,-5,5},AspectRatio->Automatic,ContourStyle->{RGBColor[1,0,0],RGBColor[0,1,0]},Frame->False,Axes->True]

bod=Graphics[{AbsolutePointSize[10],RGBColor[0,0,1],Point[r]}]

Show[priamky,bod]

Det[B]

RowReduce[B]//MatrixForm

MatrixRank[B]

jadro=NullSpace[B]

{w}=jadro;
w

B.w

B.(c w)

B.(r+c w)//Simplify

riesenie=r+c w

ParametricPlot[riesenie,{c,-1,1},AspectRatio->Automatic,PlotStyle->RGBColor[1,0,0]]

(B={{1,2},{2,4}})//MatrixForm

b={1,5}

r=LinearSolve[B,b]

priamky=ContourPlot[{x+2 y==1,2 x+4 y==5},{x,-5,5},{y,-5,5},AspectRatio->Automatic,ContourStyle->{RGBColor[1,0,0],RGBColor[0,1,0]},Frame->False,Axes->True]

MatrixRank[B]

(BB=Transpose[{(Transpose[B])[[1]],(Transpose[B])[[2]],b}])//MatrixForm

MatrixRank[BB]

(A={{2,-1,0},{1,2,4},{-2,0,1}})//MatrixForm

b={1,2,3}

Det[A]

RowReduce[A]//MatrixForm

MatrixRank[A]

r1=LinearSolve[A,b]

NullSpace[A]

o1=ParametricPlot3D[{((1+y)/2),y,z},{y,-5,3},{z,-5,3}]
o2=ParametricPlot3D[{2-2 y-4 z,y,z},{y,-5,3},{z,-5,3}]
o3=ParametricPlot3D[{((z-3)/2),y,z},{y,-5,3},{z,-5,3}]
bod=Graphics3D[{AbsolutePointSize[25],RGBColor[0,0,1],Point[r1]}]
Show[o1,o2,o3,bod]

A={{1,2,3},{2,3,4},{3,4,5}}

MatrixForm[A]

Table[i+j-1,{i,1,3},{j,1,3}]//MatrixForm

A//MatrixForm

Det[A]

RowReduce[A]//MatrixForm

MatrixRank[A]

b={1,2,3}

y=LinearSolve[A,b]

jadro=NullSpace[A]

{w1}=jadro;
w1

A.w1

A.(s w1)

A.(s w1+y)//Simplify

riesenie=y+s*w1

jednoriesenie=riesenie/.{s->0}

ineriesenie=riesenie/.{s->1}

ParametricPlot3D[riesenie,{s,-1,1},BoxRatios->{1,1,1},PlotStyle->{AbsoluteThickness[10],RGBColor[1,0,0]}]

o1=ParametricPlot3D[{1-2 y-3 z,y,z},{y,-5,3},{z,-5,3}]
o2=ParametricPlot3D[{0.5(2-3 y-4 z),y,z},{y,-5,3},{z,-5,3}]
o3=ParametricPlot3D[{(3-4 y-5 z)/3,y,z},{y,-5,3},{z,-5,3}]
o4=ParametricPlot3D[riesenie,{s,-5,3},PlotStyle->{AbsoluteThickness[10],RGBColor[1,0,0]}]
bod=Graphics3D[{AbsolutePointSize[15],RGBColor[0,1,0],Point[y]}];
Show[o1,o2,o3,o4,bod]

(B=Table[i*j,{i,1,3},{j,1,3}])//MatrixForm

Det[B]

RowReduce[B]//MatrixForm

MatrixRank[B]

y=LinearSolve[B,b]

jadro=NullSpace[B]

{w1,w2}=jadro

w1
w2

riesenie=y+s*w1+t*w2

jednoriesenie=riesenie/.{s->0,t->0}

ineriesenie=riesenie/.{s->1,t->0}

ParametricPlot3D[riesenie,{s,-1,1},{t,-1,1},BoxRatios->{1,1,1},ViewPoint->{2.431, -1.858, 1.168}]

Sustava 4 rovnic o 4 neznamych

7x+3y-2z+w==9
x-y+3w==3
5x-3y+2z==4
5y-2z+4w==7

A={{7,3,-2,1},{1,-1,0,3},{5,-3,2,0},{0,5,-2,4}};
MatrixForm[A]
Det[A]
b={9,3,4,7};
MatrixForm[b]
r=LinearSolve[A,b]
RowReduce[A]//MatrixForm
MatrixRank[A]

(G={{1,0,1,2},{0,1,1,2},{-2,1,2,3},{2,3,1,0}})//MatrixForm

Transpose[G]//MatrixForm

Det[G]

Inverse[G]//MatrixForm

G.Inverse[G]//MatrixForm

Inverse[G].G//MatrixForm