Carl Love

Carl Love

28115 Reputation

25 Badges

13 years, 127 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@Markiyan Hirnyk Is that entrance exam for all students entering the University, or just for those majoring in math?

@SandorSzabo Your file did not attach. This is an intermittent bug in MaplePrimes. Please try again, or post your code as plain text.

@viraghj Sorry, there was one character missing from the worksheet. Thank you for finding and reporting the problem. I've now corrected it in the original Answer. Please try again.

@Carl Love I've made an improvement to the operator &=. Now it can take anything (functions, indexed expressions) on its left side that := can take, and it will be treated the same as := treats it (it doesn't matter if it's already assigned---it will reassign it).

`&=`:= proc(f::uneval, expr::uneval)
local x:= eval(expr);
     print(op(1, subs(_f= nprintf("%a", f), _x= x, proc(_f:= expr=_x) end proc)));
     assign(f, x)
end proc:

@jimb1993 

If you say

Sol:= zip(B, X, Y);

then there are several ways to see the elements of Sol. One way:

interface(rtablesize= 50):  Sol;

The same is true of any Array with a dimension greater than 10.

The second way is to address the elements of Sol individually by indexing: Sol[1], Sol[2], Sol[3], etc.

The third way is to convert it to a list:

convert(Sol, list);

You say that you needed to convert the x and y in B to uppercase. Sorry to say it, but that cannot be true.

Copying from Excel should be no problem.

If your x and y values are in a single matrix A with the x values in the first column and the y values in the second, then you can do this:

Sol:= zip(B, A[..,1], A[..,2]);

@jamesc You just need to change the initial point from 0 to 1. It's positive 1 because I've taken the mirror-image of the function and am looking at the roots on the positive axis, because NextZero only works in the positive direction.

N:= 100:  #Number of roots desired.
Root:= Array(1..N):
#NextZero only works in the positive (forward or rightward) direction.
#We want roots in the negative direction. We need to translate the negative
#roots to the positive axis by using f(-p) and then negating the found root.
Root[1]:= -RootFinding:-NextZero(p-> f(-p), 1):
for n to N-1 do
     Root[n+1]:= -RootFinding:-NextZero(p-> f(-p), -Root[n])
end do;

By the way, that critical point is at exactly p = -0.75.

 

@J F Ogilvie The name of the command is applyrule; apply is a separate command. You have

apply(Rule, %);

which should be

applyrule(Rule, %);

@sarra 

It is natural for you to try what you did, but it doesn't work because a series is a special data structure in Maple, which can't be simplified by the normal rules. You can use convert(eq7, polynom), but this eliminates the order terms. You will need to add back O(h^3) manually. Note that O doesn't obey normal arithmetic: O(h^3) - O(h^3) is still O(h^3) rather than zero or O(0). All this is why I recommended the simple form

y(x+h) - y(x-h):  % = series(%, h=0, 3);

The series command (and other commands that produce the series data structure, such as taylor) understands the special rules about O, but other commands do not.

@acer

Thanks for the information about in! I usually use = because it's fewer characters, but now this small difference in timing and large difference in memory requires more investigation.

For large-scale use of parse for digit conversion you should probably use a table:

Parse:= proc()  option remember;  parse(args)  end proc:

Since Maple 18 has just been announced, I'd like to point out a new feature that is relevant to your analysis: CodeTools:-Usage now reports garbage collection time as a separate category.

F1:= proc(x)
local y;
     y:= sprintf("%a", op(1,x));
     if length(y) > 400000 then
          [Threads:-Seq(Parse(s), s in y)]
     else
          [seq(Parse(s), s in y)]
     end if
end proc:

x:= evalf[1000000](5555/7):

CodeTools:-Usage(F1(x)):

memory used=51.00MiB, alloc change=24.75MiB, cpu time=2.80s, real time=1.04s, gc time=46.88ms

 

@alshehri 

Yes, just subtract one expression from the other. The y(x) terms cancel, as well as the terms having h^2.

 

@alshehri 

The h=0 is the expansion point, i.e., it's the Taylor series at or about h=0. The 3 is because I wanted terms upto O(h^3).

@alshehri 

y(x+h):  % = series(%, h=0, 3);

y(x-h):  % = series(%, h=0, 3);

 

@alshehri 

y(x+h)-y(x-h):  % = series(%, h=0, 3);

Your file did not attach. This is an intermittent bug in MaplePrimes. Please try again.

@landivar Have you tried a simple restart; ?

If that doesn't work, try plotsetup(inline); , then retry the plot3d.

If that doesn't work, try adding the option thickness= 2 to the plot3d. This thickens the gridlines.

If that doesn't work, try adding options style= wireframe, color= black to the plot3d. This should show only the gridlines.

Do you remember which examples you ran?

First 564 565 566 567 568 569 570 Last Page 566 of 710