50 Reputation

5 Badges

2 years, 181 days

MaplePrimes Activity

These are replies submitted by mschneider


a := parse(SubstituteAll(convert(exp(2), string), "exp(", "exp(1)^("));

b := (exp(1))^2;


@Christian Wolinski 

This doesn't help...

If I set Digits:=25 the error occurs in the 25th place value.
If I set Digits:=50 the error occurs in the 50th place value.

for i from 25 to 30 do

Digits := i;

c = evalf((exp(1))^2); d = evalf(exp(2));

end do;

This doesn't help if the CAS cannot evaluate e^(2t) - exp(2t).

a := exp(2);

b := (exp(1))^2;


for i to 5 do

precision := 10+i:


end do;


here is what I have so far...


response := "(x+3)(x-1)/(x-1)";
response1 := SubstituteAll(response, `)(`, `)*(`);

now I need to be able to compare answer to response1....  as soon as I parse response1 it reduces to answer....  which is not what I want.

Any thoughts on how to parse and expand response1 at the same time?




The challenge I am having is particularly with the bimodal distribution and how to attain the data set....  Also looking to find out how to generate a dataset that is left or right skewed?

@Kitonum  @Carl Love 


Thank-you both, the larger purpose of this Maple call is MapleTA.  Your suggestions have been helpful, thank-you.




let me rephrase:


I would like to build a Maple call, whereby 5*x^3+7*x^2+2*x^3 is somehow exported to latex without collecting like terms.

I cannot seem to get it to work.

any help would be much appreciated.




@acer that worked very well.  Thank-you.  I would have never thought that would work. I tried Char() with string tools and everything else, but your exceptionally simple idea worked exceptionally well.



The code is being used in MapleTA and I require MathML output not simple print output.

I need 7/9 ; 1/4  displayed as output as MathML...


Problem seems to be fixed (but I am sure it could have been done in a single generation of MathML, rather than 3 seperate generations.




That is exactly what I was looking for thanks Tom.  I knew I needed some combination of sequence and rand, but couldn't figure out how to order it.  Your suggestions will work grandly.

@Carl Love 

I tried:

sys := { z = 4, x+y= 10, x-y = 5 };
L:=solve(sys, [x,y,z] );
eval([x,y,z], L);

and I am getting an error, hoping to display the ordered tuple.


Here is a photo of what happens when MapleTA runs the question when only producing one root, even though there are, as you admit, either 2 or 4 roots given the low h value.


What I am referring to is MapleTA, not the maple package (mapleTA).  Perhaps you do not use the program and hence really fail to understand.

Essentially MapleTA is an online assessment tool that uses the maple CAS to evaluate certain things. Some of the programming requires a call out to a server running maple. 

On my local machine I have never had a problem running the script and it sounds like you have not either. However when MapleTA calls out to the server to evaluate the code it only produces a single root (for actually the majority of randomizations). 

If you have Maple TA attempt to creat a question with the above code, and I assure you your algorithmic preview will produce one root the majority of times, which is very problematic and signs of a bug in MapleTA (which is different than the package mapleTA within maple).


The most intersting part is that I have only ever gotten the same as what you suggest, 2 root and 4 root solution sets, on my local system.  Within mapleTA it seems to very-very often attain single root solution sets (which given my h-value is impossible).


When I check the variable values for these solutions and then go in and manually fix the values to the same constants then re-run, then the mapleTA  server will then find all the roots.  In other words the mapleTA server only finds a single root, on many-many occassions, however it will find both roots when the variables are fixed to the identical values that are randonly generated.  This leads me to know there is a bug with Maple running on the MapleTA server.

I corected the placement of the restart and the other suggestions regarding variable timeT (thanks for the advice Tom however the suggestions really were not very applicable to a resolution, except for possibly the ill-placed restart).  In any case I am on the hunt for a solution...

Essentially I am looking for a function with guaranteed zeros at t=0 and 90ish (f(t)=-t(t-90))... that is periodic between the zeros (f(t)=-t(t-90)(some trig function that doesn't cross the horizontal axis).  The concept is a rollercoaster type question in mapleTA (height of the coaster versus time).  One of the questions about the function is at what time(s) is the coaster 10 feet from the ground.  The major issue I am having is that for certain random generations, mapleTA only recognizes one possible input value given a specific output (between 0 and max height) despite there obviously being at least two inputs that match the output (according to the graph).

a := MapleTA:-Builtin:-range(1800, 2300, 100):
b := (1/10)*MapleTA:-Builtin:-range(4, 8, 1):
timeT := MapleTA:-Builtin:-range(70, 100, 10):
f := -t*(b*t-b*timeT)^2*(cos(.15*t+4)^2-3)/a:
maxs := NLPSolve(f, t = 0 .. timeT, maximize):
maxim := maxs[1]:
graph := plot(f, t = 0 .. timeT, gridlines = true, 0 .. maxim+10, labels = [t, h(t)], labeldirections = [horizontal, vertical]);
h_given := 10;
expr := h_given-f:
answer_t := Student:-Calculus1:-Roots(expr, t = 0 .. timeT);
evalf(answer_t, 2);

Page 1 of 1