Download this introduction
Transcript
This is an example of a list in SAGE. You can enclose any data with [ and ], and separate the entries with commas, to make a list. This is our first example, but we’ll see another one, on Page 32, in solving equations; in Number Theory on Page 57, and in scatter plotting data, on Page 62. However, it is important not to get carried away. Rarely does it make sense for four functions to appear together in one graph. For example plot([sin(x),cos(x),sin(2*x),cos(2*x)], 0, 10) makes a total mess, as you can see To do multiple functions in multiple colors, the command is actually to add the plots: plot(sin(x), 0, 10, color=’purple’) + plot(cos(x), 0, 10, color=’blue’) which produces something quite readable: Or perhaps plot(sin(x), 0, 10, color=’purple’) + plot(cos(x), 0, 10, color=’blue’) + plot(sin(2*x), 0, 10, color=’green’) + plot(cos(2*x), 0, 10, color=’red’) which is not readable but certainly is very pretty, as you can see: 68