Linda,
Try the question below. Here is the outline:
Generate linear functions f1(x,y,z) and f2(x,y,z) and associated linear equations.
Then take the student response, which is a list
$RESPONSE=[x=a+b*t,y=c+d*t,z=e+f*t] and have Maple turn these into function. For example, unapply(rhs($RESPONSE[1]),t);
Generate two points on the line defined by $RESPONSE using these functions.
Have Maple verify that each of the two points satisfies both linear equation, and that the two points are not equal. End of outline, MapleTA script follows.
...
question=Find parametric equations for the line of intersection of the two planes $eq1ml and $eq2ml.
Enter your answer as a list of equations, use the letter "t" for the parameter, and use * for multiplication. So your answer might look like
$exampleml@
maple=X:=unapply(rhs($RESPONSE[1]),t);
Y:=unapply(rhs($RESPONSE[2]),t);
Z:=unapply(rhs($RESPONSE[3]),t);
check1:=evalb(simplify($f1(X(0),Y(0),Z(0))-($d1))=0
and simplify($f2(X(0),Y(0),Z(0))-($d2)=0));
check2:=evalb(simplify($f1(X(1),Y(1),Z(1))-($d1))=0
and simplify($f2(X(1),Y(1),Z(1))-($d2)=0));
check3:=evalb(not([X(0),Y(0),Z(0)]=[X(1),Y(1),Z(1)]));
evalb(check1 and check2 and check3);@
type=maple@
mode=Maple@
name=Two planes intersect in a line@
algorithm=$a1=range(-5,5);
$b1=range(-5,5);
$c1=range(-5,5);
$d1=range(-5,5);
$a2=range(-5,5);
$b2=range(-5,5);
$c2=range(-5,5);
$d2=range(-5,5);
condition:ne($a1*($b2)-($a2)*($b1),0);
$f1=maple("proc(x,y,z) $a1*x+($b1)*y+($c1)*z end proc");
$f2=maple("proc(x,y,z) $a2*x+($b2)*y+($c2)*z end proc");
$eq1ml=maple("printf(MathML:-ExportPresentation($f1(x,y,z)=$d1))");
$eq2ml=maple("printf(MathML:-ExportPresentation($f2(x,y,z)=$d2))");
$exampleml=maple("printf(MathML:-ExportPresentation([x=3*t-1,y=4*t+5,z=2-4*t]))");@
Linda,
Try the question below. Here is the outline:
Generate linear functions f1(x,y,z) and f2(x,y,z) and associated linear equations.
Then take the student response, which is a list
$RESPONSE=[x=a+b*t,y=c+d*t,z=e+f*t] and have Maple turn these into function. For example, unapply(rhs($RESPONSE[1]),t);
Generate two points on the line defined by $RESPONSE using these functions.
Have Maple verify that each of the two points satisfies both linear equation, and that the two points are not equal. End of outline, MapleTA script follows.
...
question=Find parametric equations for the line of intersection of the two planes $eq1ml and $eq2ml.
Enter your answer as a list of equations, use the letter "t" for the parameter, and use * for multiplication. So your answer might look like
$exampleml@
maple=X:=unapply(rhs($RESPONSE[1]),t);
Y:=unapply(rhs($RESPONSE[2]),t);
Z:=unapply(rhs($RESPONSE[3]),t);
check1:=evalb(simplify($f1(X(0),Y(0),Z(0))-($d1))=0
and simplify($f2(X(0),Y(0),Z(0))-($d2)=0));
check2:=evalb(simplify($f1(X(1),Y(1),Z(1))-($d1))=0
and simplify($f2(X(1),Y(1),Z(1))-($d2)=0));
check3:=evalb(not([X(0),Y(0),Z(0)]=[X(1),Y(1),Z(1)]));
evalb(check1 and check2 and check3);@
type=maple@
mode=Maple@
name=Two planes intersect in a line@
algorithm=$a1=range(-5,5);
$b1=range(-5,5);
$c1=range(-5,5);
$d1=range(-5,5);
$a2=range(-5,5);
$b2=range(-5,5);
$c2=range(-5,5);
$d2=range(-5,5);
condition:ne($a1*($b2)-($a2)*($b1),0);
$f1=maple("proc(x,y,z) $a1*x+($b1)*y+($c1)*z end proc");
$f2=maple("proc(x,y,z) $a2*x+($b2)*y+($c2)*z end proc");
$eq1ml=maple("printf(MathML:-ExportPresentation($f1(x,y,z)=$d1))");
$eq2ml=maple("printf(MathML:-ExportPresentation($f2(x,y,z)=$d2))");
$exampleml=maple("printf(MathML:-ExportPresentation([x=3*t-1,y=4*t+5,z=2-4*t]))");@
Maple 11 sure is much better than earlier releases when it comes to math symbols in captions.
I am impressed.
But MATLAB has had a LaTeX Interpreter for quite some time, and this makes it trivial to include 2D math in graphics. LaTeX would not force 2(x+y) to be 2x+2y.
Dr. Kaplan,
I am a huge fan of LaTeX, and I routinely write MapleTA questions. At first I was very excited about using LaTeX to author MapleTA questions. But there were so many bugs in the translation/conversion that I simply had to make a Hobson's choice.
I decided not to pursue authoring MapleTA questions with LaTeX. I just use the MapleTA script when authoring MapleTA questions. This is a disappointment to me. I suppose it is one of the consequences that Maple pays for pushing MapleTA before it was ready. If LaTeX and MapleTA are ever integrated, do I really have time and motivation to go back and redo my question banks?
Mixing LaTeX, html, Maple etc. seems too much to expect, even at this late time.
Dr. Kaplan,
I am a huge fan of LaTeX, and I routinely write MapleTA questions. At first I was very excited about using LaTeX to author MapleTA questions. But there were so many bugs in the translation/conversion that I simply had to make a Hobson's choice.
I decided not to pursue authoring MapleTA questions with LaTeX. I just use the MapleTA script when authoring MapleTA questions. This is a disappointment to me. I suppose it is one of the consequences that Maple pays for pushing MapleTA before it was ready. If LaTeX and MapleTA are ever integrated, do I really have time and motivation to go back and redo my question banks?
Mixing LaTeX, html, Maple etc. seems too much to expect, even at this late time.
In this case you can solve for delta in terms of beta and Omega and get away with plot3d instead of implicitplot3d. In this way you end up computing points on the surface instead of playing "Battleship" against the equation in three variables:
ex:=solve(F(beta,Omega,delta)=0,delta);
del:=(beta,Omega)->piecewise(h(beta,Omega)>0,ex,undefined);
plots[display](
plot3d(del(beta,Omega),beta=0.01...1,Omega=0.1..10,axes=boxed,grid=[61,61]),
plot3d(del(beta,Omega),beta=0.01...1,Omega=-0.01..-10,axes=boxed,grid=[61,61]),
plot3d(del(beta,Omega),beta=-0.01...-1,Omega=-0.01..-10,axes=boxed,grid=[61,61]),
plot3d(del(beta,Omega),beta=-0.01...-1,Omega=0.01..10,axes=boxed,grid=[61,61])
);
In this case you can solve for delta in terms of beta and Omega and get away with plot3d instead of implicitplot3d. In this way you end up computing points on the surface instead of playing "Battleship" against the equation in three variables:
ex:=solve(F(beta,Omega,delta)=0,delta);
del:=(beta,Omega)->piecewise(h(beta,Omega)>0,ex,undefined);
plots[display](
plot3d(del(beta,Omega),beta=0.01...1,Omega=0.1..10,axes=boxed,grid=[61,61]),
plot3d(del(beta,Omega),beta=0.01...1,Omega=-0.01..-10,axes=boxed,grid=[61,61]),
plot3d(del(beta,Omega),beta=-0.01...-1,Omega=-0.01..-10,axes=boxed,grid=[61,61]),
plot3d(del(beta,Omega),beta=-0.01...-1,Omega=0.01..10,axes=boxed,grid=[61,61])
);
Maybe you can use procs instead of "double non-evaluation" marks:
Afill:=proc(i,j);a[i,j] end;
Bfill:=proc(i,j); b[i,j] end;
A:=proc( ) Matrix(3,3,Afill);end;
A( );
B:=proc( ) Matrix(3,3,Bfill);end;
B( );
C:=proc( ) A( ).B( );end;
C( );
Afill(1,1):=c:
Afill(1,2):=r:
Afill(2,1):=p:
Afill(2,2):=q:
C( );
Wow!
I remember looking and looking for Exponential to no avail, and did not notice LinearAlgebra[MatrixExponential]
I was so completely focused on finding "Exponential" instead of linalg[exponential] that I never noticed MatrixExponential.
It was right in front of my nose all this time, but not in front of my eyes. Thanks.
Suppose you created matrices as follows:
with(LinearAlgebra):
A:=Matrix(2,2,(i,j)->a[i,j]);
B:=Matrix(4,4,(i,j)->b[i,j],shape=symmetric);
and then do things like
(subs(A[2,2]=-A[1,1],A.A));
or
Determinant(M).
Does this give you the symbolic level that you are looking for?
What I really miss from linalg is exponential!
To compute exp(M) for Matrix M with LinearAlgebra takes some hustle and busy work, but all you and to do with a matrix M was linalg[exponential](M) and presto, you got your result.
I see three mistakes:
When you set up J and K with DEplot, you need t=0..50, not just 0..50. That's two of the mistakes.
The third is in your last line: you need plots instead of plot. Of course since you invoked with(plots): your last line could simply be
display(J,K);
Also be sure to include the line
with(DEtools):
to load in DEplot.
I see three mistakes:
When you set up J and K with DEplot, you need t=0..50, not just 0..50. That's two of the mistakes.
The third is in your last line: you need plots instead of plot. Of course since you invoked with(plots): your last line could simply be
display(J,K);
Also be sure to include the line
with(DEtools):
to load in DEplot.
Your problem is still not clearly stated. For example, we can find a solution to the third order diffeq that satisfies f(0)=0, f(4)=1 and f(-4)=0.5 using a "double shooting" method as outlined below. Then take g=f! What you are requiring of the parameter C in your post is vague.
It turns out that f ' (0)= 0.76 and f ''(0)=0.12 is close (eyeballing from the graph).
> with(plots):
> sys:=proc(a,b)
{diff(y(x),x$3)+1/2*y(x)*diff(y(x),x$2)=0,y(0)=0,
D(y)(0)=a,D(D(y))(0)=b};
end;
> soln:=proc(a,b)
dsolve(sys(a,b),numeric);
end;
> soln(1,1)(4);
> val1:=proc(a,b)
rhs(soln(a,b)(4)[3]);
end;
> val2:=proc(a,b)
rhs(soln(a,b)(-4)[3]);
end;
> display
(
implicitplot('val1(a,b)=1',a=0..1,b=0..1),
implicitplot('val2(a,b)=0.5',a=0..1,b=0..1)
);
#Read off values of a and b from the graph.
> val1(.76,0.12);
> val2(.76,0.12);
Refine values of a and b as needed.
Your problem is still not clearly stated. For example, we can find a solution to the third order diffeq that satisfies f(0)=0, f(4)=1 and f(-4)=0.5 using a "double shooting" method as outlined below. Then take g=f! What you are requiring of the parameter C in your post is vague.
It turns out that f ' (0)= 0.76 and f ''(0)=0.12 is close (eyeballing from the graph).
> with(plots):
> sys:=proc(a,b)
{diff(y(x),x$3)+1/2*y(x)*diff(y(x),x$2)=0,y(0)=0,
D(y)(0)=a,D(D(y))(0)=b};
end;
> soln:=proc(a,b)
dsolve(sys(a,b),numeric);
end;
> soln(1,1)(4);
> val1:=proc(a,b)
rhs(soln(a,b)(4)[3]);
end;
> val2:=proc(a,b)
rhs(soln(a,b)(-4)[3]);
end;
> display
(
implicitplot('val1(a,b)=1',a=0..1,b=0..1),
implicitplot('val2(a,b)=0.5',a=0..1,b=0..1)
);
#Read off values of a and b from the graph.
> val1(.76,0.12);
> val2(.76,0.12);
Refine values of a and b as needed.
Now I see what you mean. I had guessed that I was missing your point.
Interesting that if you make y global instead of local in outerproc, then it prints 1 and returns 1 instead of printing e^0 and returning 1.