Carl Love

Carl Love

28055 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@nm How did it occur to you that student[changevar] would do the trick?

Welcome to MaplePrimes, Roby. It is very helpful for the people who will debug your code here that you either post your code in plaintext form or that you attach a worksheet or both. That way they do not need to retype it. You can attach a worksheet by using the green arrow, which is the last item in the second row of the toolbar of the MaplePrimes editor.

Float(undefined) is not always an indication of an error. For example, it is a reasonable and correct answer to

evalf(Int(sin(x), x= 0..infinity));

 

When you're asking Maple for an exact solution, it is best to avoid the use of floating-point constants. You should change 0.048 to 48/1000. If you still get Float(undefined) (rather than simply undefined), that would be an indication of an error.

@gkokovidis wrote:

plot([seq(1/x, x = 0.1 .. 1,.1)], ([seq(x^2, x = 0.1 .. 1,.1)]), style = line);

The same thing can be achieved with

plot([1/x, x^2, x= 0.1..1]);

with the added benefit that plot chooses the intermediate values of x.

@Carl Love 

In Maple 16, I am having the same problem as the OP with releasing the memory, even after I clear %, %%, and %%% and run gc() several more times!

@casperyc 

Yes, if the operation is adding a new element to an existing container, it seems that the best container to use is a Vector. This is surprising; stretching a Vector past its declared bounds is an expensive operation in many languages. I don't know how Maple manages this.

It is best to use seq and other built-in list-processing commands such as select rather than a for loop. Though sometimes there's no way to avoid the for loop. However one can always avoid the dreaded list-stretching operation L:= [op(L), x].

@Joe Riel 

Thanks, Joe. I knew about _rest at one point, but I had forgotten. Code updated in Answer.

@Muhammad Ali 

I am using Maple 18.00 / 64 on Windows 8.1 / 64.

@wenny Why not just take the advice of the error message and simply change {u1 > 40, u2 > 30} to {u1 >= 40, u2 >= 30}?

@Kitonum

Kitonum: I, and others on MaplePrimes, have told you on numerous occasions that in Maple it is extremely inefficient to build a list (or set) by adding elements one at a time to an existing list (or set). Yet you continue to do it often. While it is not always possible to avoid the need to add the elements one at a time, it is always possible to avoid adding them to a list or set by adding them to a table or Vector and converting to a list or set when you're done adding. Observe:

List_by_op:= proc(n::posint)
local i, L:= []:
     for i to n do L:= [op(L), i] end do
end proc:

List_by_table:= proc(n)
local i, L:
     for i to n do L[i]:= i end do;
     convert(L, list)
end proc:

List_by_Vector:= proc(n)
local i, L:= Vector(0):
     for i to n do L(i):= i end do;
     convert(L, list)
end proc:

time(List_by_op(2^15));
     5.616

time(List_by_table(2^15));
     0.093

time(List_by_Vector(2^15));
     0.046

@Kitonum 

But the desired output is, I believe,

Your procedure is the inverse function of the desired procedure.

@Alejandro Jakubi 

So, if you are at this situation, the most efficient usage of your RAM resources is using the CLI as much as possible.

Or not displaying large results, including plots with a large number of data points and animations with a large number of frames. Plots can be sent to a separate window.

@Markiyan Hirnyk 

Vote up is mine.

I can't find documentation for the option domain= real. Do you know where I can find that?

What happens for you when you try the solve command that you posted? For me, it works, producing a medium-length answer (about 5 screens full).

@casperyc Have you ever clicked on that "Your Contributions" and gotten it to work? It has never worked for me.

Do you have any initial conditions?

First 536 537 538 539 540 541 542 Last Page 538 of 709