Linda A.

73 Reputation

5 Badges

15 years, 73 days

MaplePrimes Activity


These are replies submitted by Linda A.

I want to make sure I totally understand your logic. Why do we have to unapply(rhs(response[1]))? Is that not equal to response[1]?
I want to make sure I totally understand your logic. Why do we have to unapply(rhs(response[1]))? Is that not equal to response[1]?
I would love the help with my .qu file but i can't get it to upload to the mapleprimes site. It won't take this type of file. Below is the source code. I wrote it in Maple first but that does not help with the "type" of variable $response is. question=Given the two planes:

$line1_show

$line2_show

Enter the parametric equations for the line of intersection:

(enter in the format: x=x0+a*t,y=y0+b*t,z=z0+c*t )@ maple=$x= subs(t = 0, $response[1]); $y= subs(t = 0, $response[2]); $z= subs(t = 0,$response[3]); $a=subs(t = 1, $response[1])-($x); $b=subs(t=1,$response[2])-($y); $c=subs(t = 1,$response[3])-($z); $line1sub := subs({x = $x, y = $y, z = $z}, $line1); $check1= `if`($line1sub = $p1, true, false); $line2sub= subs({x = $x, y = $y, z = $z}, $line2); $check2= `if`($line2sub = $p2, true, false); $check3= `if`(LinearAlgebra:-CrossProduct(Vector([$a, $b, $c]), $uvcross) = 0, true, false); $check4= `if`($x1 = 0 and $x2 = 0 and $x3 = 0, false, true); `if`(`and`(`and`(`and`($check1 = true, $check2 = true), $check3 = true), $check4 = true), true, false);@ type=maple@ mode=Maple@ name=dummy 2 plane@ editing=useHTML@ algorithm=$x1=1; $y1=2; $z1=3; $x2=4; $y2=1; $z2=2; $p1=6; $p2=3; $line1=$x1*x+$y1*y+$z1*z; $line2=$x2*x+$y2*y+$z2*z; $line1_show=maple("printf(MathML:-ExportPresentation(expand($x1*x+$y1*y+$z1*z=$p1)))"); $line2_show=maple("printf(MathML:-ExportPresentation(expand($x2*x+$y2*y+$z2*z=$p2)))"); $sol=maple("solve({$x1*x+$y1*y=$p1,$x2*x+$y2*y=$p2},[x,y])"); $xvalue=maple("(rhs($sol[1,1]))"); $yvalue=maple("(rhs($sol[1,2]))"); $uvect=maple("Vector([$x1,$y1,$z1])"); $vvect=maple("Vector([$x2,$y2,$z2])"); $ushow=maple("printf(MathML:-ExportPresentation(u=$uvect))"); $vshow=maple("printf(MathML:-ExportPresentation(v=$vvect))"); $pv_cross = maple("LinearAlgebra[CrossProduct]($uvect,$vvect)"); $pvshow=maple("printf(MathML:-ExportPresentation($pv_cross))"); @

I would love the help with my .qu file but i can't get it to upload to the mapleprimes site. It won't take this type of file. Below is the source code. I wrote it in Maple first but that does not help with the "type" of variable $response is. question=Given the two planes:

$line1_show

$line2_show

Enter the parametric equations for the line of intersection:

(enter in the format: x=x0+a*t,y=y0+b*t,z=z0+c*t )@ maple=$x= subs(t = 0, $response[1]); $y= subs(t = 0, $response[2]); $z= subs(t = 0,$response[3]); $a=subs(t = 1, $response[1])-($x); $b=subs(t=1,$response[2])-($y); $c=subs(t = 1,$response[3])-($z); $line1sub := subs({x = $x, y = $y, z = $z}, $line1); $check1= `if`($line1sub = $p1, true, false); $line2sub= subs({x = $x, y = $y, z = $z}, $line2); $check2= `if`($line2sub = $p2, true, false); $check3= `if`(LinearAlgebra:-CrossProduct(Vector([$a, $b, $c]), $uvcross) = 0, true, false); $check4= `if`($x1 = 0 and $x2 = 0 and $x3 = 0, false, true); `if`(`and`(`and`(`and`($check1 = true, $check2 = true), $check3 = true), $check4 = true), true, false);@ type=maple@ mode=Maple@ name=dummy 2 plane@ editing=useHTML@ algorithm=$x1=1; $y1=2; $z1=3; $x2=4; $y2=1; $z2=2; $p1=6; $p2=3; $line1=$x1*x+$y1*y+$z1*z; $line2=$x2*x+$y2*y+$z2*z; $line1_show=maple("printf(MathML:-ExportPresentation(expand($x1*x+$y1*y+$z1*z=$p1)))"); $line2_show=maple("printf(MathML:-ExportPresentation(expand($x2*x+$y2*y+$z2*z=$p2)))"); $sol=maple("solve({$x1*x+$y1*y=$p1,$x2*x+$y2*y=$p2},[x,y])"); $xvalue=maple("(rhs($sol[1,1]))"); $yvalue=maple("(rhs($sol[1,2]))"); $uvect=maple("Vector([$x1,$y1,$z1])"); $vvect=maple("Vector([$x2,$y2,$z2])"); $ushow=maple("printf(MathML:-ExportPresentation(u=$uvect))"); $vshow=maple("printf(MathML:-ExportPresentation(v=$vvect))"); $pv_cross = maple("LinearAlgebra[CrossProduct]($uvect,$vvect)"); $pvshow=maple("printf(MathML:-ExportPresentation($pv_cross))"); @

I am just getting going with this whole concept and I had to jump in a little deeper than I have experience with. Your help has been teriffic. Now on to solving for the extreme values and saddle points!
Where you placed the actual numbers, I need to put an reference to the value returned from the solve command in the line above. I can't get the references right. The solve command returns two sets of values for the three variables. If I want to use the x and y from the first set of solutions, how do I reference them? ans1:=subs({x=expr3[1,1],y=expr3[1,2]},f); This does not work. It does not return the value defined in the set of solve solutions
In Maple TA all variables are defined with a $ in front of them, such as my espressions $f, $q, and $g. Variables which are unknown such as x,y,z, and mu do not have the $ as they can be solved for. I taking the partial differentials of g with respect to x and y and then solving for the three unknowns with the solve command. I then need to replace those variable "names" or values in the f command for the original x and y so that I can solve for z. I will nest this in a loop so that all x and y values are evaluated but at this time, I am just trying to retreive one set so that I can see what I am doing. The solve returns two sets of answers and I am not having any luck retreiving the individual values. Any help is great. It is very confusing to have the syntax different in Maple and Maple TA. Not a great choice on their part. Thanks
appreciate the help but it is not working. I would guess that when you say nested[1][2], you are indicating that the value returned is the second value in the first set. If I try that, I just get the set listed with indicies on my variables. If you see my original code, and put $exp3[2][1]into the first set of ????, it does not acknowledge that I am trying to retreive a single value from the list.
Page 1 of 1