Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 360 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@BobWild That is correct; only the boundary conditions are needed.

@Ratch I see what you mean. The first two terms should be 1+x instead of x+1, and when the slider is set to 49 or 50, the last two terms are inverted also.

I can't find the underlying startup code. How do I get to it?

Could you please provide more details of your situation? some example values perhaps? or a worksheet?

@Carl Love I just significantly updated this Answer to use plots:-loglogplot rather than a simple point plot with logarithmic axes. So, it is more in line with your question.

@highsciguy After applying the first evalindets, hit it with

evalindets(%, identical(1.), 1);

Please, let me know how that goes!

@Joe Riel For me, your post that compares all the Cartesian product procedures is the top hit when I enter "Cartesian product" (without quotes) into the MaplePrimes search bar. It is dated April 27, 2010, which may be why you're having trouble finding it. There are hundreds (maybe thousands) of posts and questions with that date, so I guess that a lot of old posts had their date changed to that in some "update".

@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

 

First 563 564 565 566 567 568 569 Last Page 565 of 709