Reputation: 21
I'm having problem with my Maple project. I want to plot three linear equations, I'm using LinearSystemPlot
function. But I also want to make it more interactive, so I though to use Explore
function. I tried to find some help on internet, but couldn't find anything relevant. This is what I was able to do
restart;
with(Student[LinearAlgebra]);
with(LinearAlgebra, SubMatrix);
s := [-u*z+x-2*y = -2, x+y-2*z = 7, 2*x+y-3*z = -v];
Explore(LinearSystemPlot(s, colors = [plum, maroon, pink]), parameters = [u = -10 .. 10, v = -20 .. 20], placement = bottom);
When I execute it, I get correct graph with sliders under it. Problem is, when I want to change value of u
or v
, I get this error
(in Student:-LinearAlgebra:-LinearSystemPlot) the system does not contain 2 or 3 variables
Error in Component Slideru with caption "Slider"
I'm using Maple2015, if it's important.
Thank you for any help.
Upvotes: 2
Views: 101
Reputation: 7246
Any of the following ways should work in your Maple 2015.
The first way involves explicitly entering the list inside the call to the LinearSystemPlot
command. This way requires explictly typing the list into the command, but the exploration may work immediately after restart.
The next pair explore a function call, to H
and F
respectvely. The first of those is similar in methodology to some examples on the ?examples,Explore
help page.
Note that in the third and fourth ways I use single left-quotes (aka uneval quotes, to delay evaluation). You'd need to type those just as I have them, with the correct kind of quotes.
The Explore command has special evaluation rules on its first argument, and my use of uneval quotes is to allow Explore to see the list that's been assigned to s
(and not just the name s
).
restart;
Explore( Student:-LinearAlgebra:-LinearSystemPlot(
[-u*z+x-2*y = -2, x+y-2*z = 7, 2*x+y-3*z = -v],
colors=[plum,maroon,pink] ),
parameters = [u = -10 .. 10.0, v = -20 .. 20.0] );
restart;
H :=proc(U,V)
uses Student:-LinearAlgebra;
LinearSystemPlot( [-U*z+x-2*y = -2, x+y-2*z = 7, 2*x+y-3*z = -V],
colors=[plum,maroon,pink] );
end proc:
Explore( H(u,v),
parameters = [u = -10 .. 10.0, v = -20 .. 20.0] );
restart;
s := [-u*z+x-2*y = -2, x+y-2*z = 7, 2*x+y-3*z = -v]:
F := unapply( 'Student:-LinearAlgebra:-LinearSystemPlot'(s, colors=[plum,maroon,pink]),
[u,v] ):
Explore (F(u,v),
parameters=[u=-10 .. 10.0, v=-20 .. 20.0] );
restart;
s := [-u*z+x-2*y = -2, x+y-2*z = 7, 2*x+y-3*z = -v]:
eval( 'Explore'('Student:-LinearAlgebra:-LinearSystemPlot'(s, colors=[plum,maroon,pink]),
parameters=[u=-10 .. 10.0, v=-20 .. 20.0] ) );
And here's a variant on the second way above. With this way you can adjust the list s
and continue to explore without having to call Explore
once more.
restart;
s := [-u*z+x-2*y = -2, x+y-2*z = 7, 2*x+y-3*z = -v]:
H :=proc(U,V)
global s;
uses Student:-LinearAlgebra;
LinearSystemPlot( eval(s, [u=U, v=V]),
colors=[plum,maroon,pink] );
end proc:
Explore( H(u,v),
parameters = [u = -10 .. 10.0, v = -20 .. 20.0] );
You may wish to experiment with a fixed view on the plots (using the view
option to the LinearSystemPlot
command).
Upvotes: 1