jaytreiman

273 Reputation

12 Badges

20 years, 35 days

MaplePrimes Activity


These are answers submitted by jaytreiman

I specifically created an inline question to test this.  It works on my system.

What type of system are you using?

 

I am using SUSE 10.2 for MapleTA 2.51.  It is necessary to set up a vertual frame buffer (VFB)

or some other mechanism for the graphics there.  That was a really painful

job.

I tried it with the MapleTA 2.51 editor and got this source.  It dispalys the

matrix. 

 

Which version of MapleTA are you using?

 

mode=Inline@
name=Try 1@
algorithm=$eig1 = range(-9,9,2);
$eig2 = range(-9,9,2);
$eig3 = range(-9,9,2);
$D = maple("Matrix([[$eig1,0,0],[0,$eig2,0],[0,0,$eig2]])");
$display1 = maple("printf(MathML[ExportPresentation]($D))");@
weighting=1,1@
numbering=alpha@
part.1.name=$eig2@
part.1.answer.units=@
part.1.numStyle=thousands scientific  arithmetic@
part.1.editing=useHTML@
part.1.showUnits=false@
part.1.question=(Unset)@
part.1.mode=Numeric@
part.1.grading=exact_value@
part.1.negStyle=minus@
part.1.answer.num=$eig1@
part.2.name=$eig2@
part.2.answer.units=@
part.2.numStyle=thousands scientific  arithmetic@
part.2.editing=useHTML@
part.2.showUnits=false@
part.2.question=(Unset)@
part.2.mode=Numeric@
part.2.grading=exact_value@
part.2.negStyle=minus@
part.2.answer.num=$eig1@
question=   

    <p style="margin-top: 0">
      What are the eigenvalues for $display1 ?
    </p>
    <p>
      Eigenvalue 1 is <1>.
    </p>
    <p>
      Eigenvalue 2 is <2>
    </p>
@
 

 

 

Sometimes Map0le does not simplify.  Try using

 

series( 1/4*sqrt(2)*sqrt(Pi)*exp(-1/2)*(erf(1/2*sqrt(2)*x-1/2*I*sqrt(2))+erf(1/2*sqrt(2)*x+1/2*I*sqrt(2)))*exp(1/2*x^2),x);

simplify(%);

 

It will combine the offending factors.

If you want to get out that format you can try the following code in MapleTA: $d=maple("Statistics[Sample]('Normal'(30000, 10000), 8); map(x->100*(round(x/100)),%); "); $e=maple("$d[1]; "); $f=$e; I do not know how to make Maple put in the commas, but MapleTA does it automatically for integrers. Does this help?

What format do you want for the answer?

 

If you are willing to use Maple formating for the input, you can require the answer to be entered in the form "[[a,b,c],[d,e,f]]."  (This is almost identical to TI-89 format.)

You then need to set up the grading appropriately by converting to a Matrix, converting to another format, or checking entry byentry.

An alternative is to send back a list of beta_star and the k as this modification of your procedure shows.  If you call the ouput A, then A[1] is beta_star and A[2] is k.

 

 beta_k := proc (P)

local k, beta, P_bar, Eq17, Eq19, sol;

P_bar := P*R^2/(E*Inert);

Eq17 := -2*k*cos(beta_star) = 1/sqrt(P_bar);

Eq19 := 4*EllipticE(k)-2*EllipticE(sin(beta_star), k)-2*EllipticK(k)+EllipticF(sin(beta_star), k) = tan(beta_star)*sqrt(1-k^2*sin(beta_star)^2);

sol := eval(fsolve({Eq17, Eq19}, {k = 0 .. .5, beta_star = Pi .. (3/2)*Pi}));

return subs(sol, [beta_star, k])

end proc

I agree w/ acer.  It may not be nice, but you have to live with those strange digits.


Which version of Maple are you using?

The following code gives 3sd for me on Maple 11, Windows.

 

A := LinearAlgebra[RandomMatrix](3,3);
b := LinearAlgebra[RandomVector](3);
soln :=LinearAlgebra[LinearSolve](A,b);
evalf(soln,3);
 

 

I do not know if this will work, but you could try,

interface(elisiondigitsafter=3);

Does someone know what this does?

I generated a question using the MathTA 3.01 question editor that generates different sizes of matrices. Here is the code it generated for finding the determinant of an nxn matrix. I hope this contains what you want. question=Find the determinant of $mathmlM .@ maple=evalb(simplify(($ANSWER)-($RESPONSE))=0);@ maple_answer=$ans;@ type=formula@ mode=Maple@ name=Matrix size@ editing=useHTML@ algorithm=$a=range(3,5,1); $M=maple("LinearAlgebra:-RandomMatrix($a,$a); "); $mathmlM=maple("printf(MathML:-ExportPresentation($M)); "); $ans=maple("LinearAlgebra:-Determinant($M)");@

I think you got two things out of op(plot1).  Try

 

plot2:=PLOT(POINTS(op(1,op(1,plot1)),COLOUR(RGB, 0, 0.2,0.5),SYMBOL(POINT))):

or

plot2:=PLOT(POINTS(op([1,1],plot1),COLOUR(RGB, 0, 0.2,0.5),SYMBOL(POINT))):

I think you want to use shift-enter.  It adds a new line without executing.

If you are always solving systems of linear equations and you know some linear algebra, you could use LinearSolve from the LinearAlgebra package by putting your equation in Matrix form. M := Matrix([[3,2,1],[4,2,2],[1,-1,1]]); b := Vector([2,8,4]); LinearAlgebra:-LinearSolve(M,b);
Here are two ways of trying to do this. The first does not work, the sum is not evaluated. subs(y[1]=2,subs(m=3,sum(r[i]*y[i],i=1..m))); The next works, with a forced evaluation. subs(y[1]=2,eval(subs(m=3,sum(r[i]*y[i],i=1..m)))); If you look at the help on sum in Maple 11 you will find the following statement. "Maple returns the call unevaluated if it cannot find a closed form." Since you do not have a closed form, Maple does not evaluate the sum and there is no "y[1]."
Please post your best code so that I can try to see what is not working.
This should work for you plot(1/sqrt(2*Pi)*Int( exp(-x^2/2),x=0..y),y); Maple uses the function exp(x) for the exponential function, not e^x. Was this your problem?
1 2 3 4 5 Page 4 of 5