Sage Math

This commit is contained in:
Marzena Grześkowiak 2019-01-30 11:23:51 +01:00
parent f90c3eaa4a
commit bfbe34406c
2 changed files with 100 additions and 0 deletions

View File

@ -0,0 +1,61 @@
︠b96febc1-f67b-401b-b5fe-20362fbe6fcc︠
#zad1
#a
rownanie=x+2==3*x-5
solve(rownanie, x)
︡45151274-5a0c-4701-a75a-ab27a2d5e98a︡{"stdout":"[x == (7/2)]\n"}︡{"done":true}
︠4ce563a4-133b-4e0d-973b-dc667e9d8f59︠
#b
rownanie2=x*x+3*x-1==0
solve(rownanie2, x)
︡af099b4d-de7c-4f4c-9f7c-abcefdedac48︡{"stdout":"[x == -1/2*sqrt(13) - 3/2, x == 1/2*sqrt(13) - 3/2]\n"}︡{"done":true}
︠b6d3ea9b-a40f-455f-9da8-d7df3d82eb97s︠
#c
rownanie3=3^x*(x^2-4)==0
solve(rownanie3, x)
︡73f15e83-e826-4f46-a165-9014f196c353︡{"stdout":"[x == -2, x == 2]"}︡{"stdout":"\n"}︡{"done":true}︡
︠b6cd8bba-d317-46d1-82e6-9653be131a52︠
#d
rownanie4=(x+2)/(x-1)==3/(2*x-5)
solve(rownanie4, x)
︡ba27d302-ec0c-47b4-b4a2-25763ba74de0︡{"stdout":"[x == -3/2*sqrt(2) + 1, x == 3/2*sqrt(2) + 1]\n"}︡{"done":true}
︠7997e2b5-c74b-4be3-8ad5-cd6951d1c361︠
#e
rownanie5=(2*x-1)*(x+2)==(x-1)^2
solve(rownanie5, x)
︡e554d26e-1849-4845-b606-9e73cd1a7f7d︡{"stdout":"[x == -1/2*sqrt(37) - 5/2, x == 1/2*sqrt(37) - 5/2]\n"}︡{"done":true}
︠e0d62a12-9fba-4a89-947c-3d1c61e7eb43s︠
#zad2
#a
var('x,y')
solve([5*x+2*y==4, x-4*y==-2],x,y)
show(implicit_plot(5*x+2*y==4,(x,-2,2),(y,-2,2), color="red")\
+implicit_plot(x-4*y==-2,(x,-2,2),(y,-2,2),color="blue")\
+points([(6/11,7/11)], size=45, color='green',figsize=4))
a=implicit_plot(5*x+2*y==4,(x,-2,2),(y,-2,2), color="red")
b=implicit_plot(x-4*y==-2,(x,-2,2),(y,-2,2),color="blue")
c=points([(6/11,7/11)], size=45, color='green',figsize=4)
a+b+c
#b
var('x,y')
solve([x^2+2*x+y^2-4*x==20, 2*x-y==0],x,y)
show(implicit_plot(x^2+2*x+y^2-4*x==20,(x,-10,10),(y,-10,10), color="red")\
+implicit_plot(2*x-y==0,(x,-10,10),(y,-10,10),color="blue")\
+points([(-1/5*sqrt(101) + 1/5,-2/5*sqrt(101) + 2/5),(1/5*sqrt(101) + 1/5,2/5*sqrt(101) + 2/5)], size=45, color='green',figsize=4))
p=implicit_plot(x^2+2*x+y^2-4*x==20,(x,-10,10),(y,-10,10), color="red")
g=implicit_plot(2*x-y==0,(x,-10,10),(y,-10,10), color="blue")
i=points([(-1/5*sqrt(101) + 1/5,-2/5*sqrt(101) + 2/5),(1/5*sqrt(101) + 1/5,2/5*sqrt(101) + 2/5)], size=45, color='green',figsize=4)
p+g+i
︡6885544e-ca6b-49f2-8017-b247a489e23e︡{"stdout":"(x, y)\n"}︡{"stdout":"[[x == (6/11), y == (7/11)]]\n"}︡{"file":{"filename":"/home/user/.sage/temp/project-57137279-018d-4802-a428-656eb095dab7/109/tmp_ugx8PL.svg","show":true,"text":null,"uuid":"d9d60160-4ffd-497a-b21c-6727c812a47c"},"once":false}︡{"file":{"filename":"/home/user/.sage/temp/project-57137279-018d-4802-a428-656eb095dab7/109/tmp_GdT8j3.svg","show":true,"text":null,"uuid":"b1624faf-f7eb-4d7d-b905-d0363cdc0b97"},"once":false}︡{"stdout":"(x, y)\n"}︡{"stdout":"[[x == -1/5*sqrt(101) + 1/5, y == -2/5*sqrt(101) + 2/5], [x == 1/5*sqrt(101) + 1/5, y == 2/5*sqrt(101) + 2/5]]\n"}︡{"file":{"filename":"/home/user/.sage/temp/project-57137279-018d-4802-a428-656eb095dab7/109/tmp_TiNtEW.svg","show":true,"text":null,"uuid":"8849ca25-0f40-43ba-8de0-e372a8d3b89b"},"once":false}︡{"file":{"filename":"/home/user/.sage/temp/project-57137279-018d-4802-a428-656eb095dab7/109/tmp_89lU7A.svg","show":true,"text":null,"uuid":"9ede7da2-6891-4f29-a85a-fb3c1fcbd93b"},"once":false}︡{"done":true}

39
Sage Math/sagematch.txt Normal file
View File

@ -0,0 +1,39 @@
#zad1
#a
rownanie=x+2==3*x-5
solve(rownanie, x)
#b
rownanie2=x*x+3*x-1==0
solve(rownanie2, x)
#c
rownanie3=3^x*(x^2-4)==0
solve(rownanie3, x)
#d
rownanie4=(x+2)/(x-1)==3/(2*x-5)
solve(rownanie4, x)
#e
rownanie5=(2*x-1)*(x+2)==(x-1)^2
solve(rownanie5, x)
#zad2
#a
var('x,y')
solve([5*x+2*y==4, x-4*y==-2],x,y)
show(implicit_plot(5*x+2*y==4,(x,-2,2),(y,-2,2), color="red")\
+implicit_plot(x-4*y==-2,(x,-2,2),(y,-2,2),color="blue")\
+points([(6/11,7/11)], size=45, color='green',figsize=4))
a=implicit_plot(5*x+2*y==4,(x,-2,2),(y,-2,2), color="red")
b=implicit_plot(x-4*y==-2,(x,-2,2),(y,-2,2),color="blue")
c=points([(6/11,7/11)], size=45, color='green',figsize=4)
a+b+c
#b
var('x,y')
solve([x^2+2*x+y^2-4*x==20, 2*x-y==0],x,y)
show(implicit_plot(x^2+2*x+y^2-4*x==20,(x,-10,10),(y,-10,10), color="red")\
+implicit_plot(2*x-y==0,(x,-10,10),(y,-10,10),color="blue")\
+points([(-1/5*sqrt(101) + 1/5,-2/5*sqrt(101) + 2/5),(1/5*sqrt(101) + 1/5,2/5*sqrt(101) + 2/5)], size=45, color='green',figsize=4))
p=implicit_plot(x^2+2*x+y^2-4*x==20,(x,-10,10),(y,-10,10), color="red")
g=implicit_plot(2*x-y==0,(x,-10,10),(y,-10,10), color="blue")
i=points([(-1/5*sqrt(101) + 1/5,-2/5*sqrt(101) + 2/5),(1/5*sqrt(101) + 1/5,2/5*sqrt(101) + 2/5)], size=45, color='green',figsize=4)
p+g+i