Carl Love

Carl Love

28115 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@Kitonum "Runs" refers to contiguous groups of the same character. So the run lengths in your random example would be 2, 1, 1, 2, 1, 3, 2, 2, 1, 2, 1, 1, 1, 1, 2, 3, 1, 3.

I have trouble following your worksheet because of the use of context-menu commands. Can you redo the worksheet with typed commands rather than context-menu commands?

@litun Yes, it's clear now. But it seems to me that fnormal handles that. Can you show me an example where fnormal does not do what you want?

How can you have a term with a factor of 0?

Doesn't fnormal do exactly what you want?

@georgepan 

There is something missing from your Reply. I still don't have the complete equation. Please attach a worksheet or enter a formula in plain text.

Is the equation correct as I entered it? 

@Kitonum Your example doesn't quite work the same way in Maple 18. It produces this plot:

The problem can be corrected by changing the order in the display command.

plots[display](B, A, scaling= constrained);

@oldstudent The simpler solution only works if the shaded region is under the entire x-range of the curve. It can be shortened to

plot(sqrt(x), x= 0..1, filled);

@oldstudent I highlighted.

While "Numerically Solve" will usually give the same results, the process used to obtain the results is vastly different.

Preben: Thanks for the information. I edited the Answer to reflect it.

@Markiyan Hirnyk I did read the help for GlobalOptima and I still can't tell why it returned such an answer for the OP's command. It doesn't matter if the constraints are changed to {x >= 0, y >= 0, z >= 0, x+y+z = 3}; it still doesn't work.

I immediately foresee numerous problems with your plan. My advice is to give up and use strings. Note that there are a few syntaxes that have been developed for the unambigous one-dimensional input of chemical formulae. Look up SMILES and SYBYL in Wikipedia.

@acer At the risk of going more tangential....

The concept of gc real time and how to measure it does not quite make sense to me. The only way that I can make sense of it is if the processing of all the other Maple processes is suspended while gc is being done. Do you know if that is true?

Please give your equation in normal characters (Maple 1D input) or attach a worksheet. What you have posted as your equation is meaningless to Maple.

@brian bovril Okay, here's a procedure to do it.

Display:= proc(res::list(indexed=nonnegint))
local S,e;
     S:= `%+`(seq(`if`(rhs(e)=0, [][],
          `if`(rhs(e)=1, ithprime(op(lhs(e))), `%*`(ithprime(op(lhs(e))), rhs(e)))
          ), e= res
     ));
     InertForm:-Display(InertForm:-Value(S) = S)
end proc:

Now just make the last line PF

Display(res[2])

@acer 

`<>` is just the prefix form of the not-equals operator. The Vector/Matrix constructors are `<,>` and `<|>`. If I call showstat on them, they do not seem builtin. I have however noticed that they are faster than Vector and Matrix. I don't see how that can be since they just call Vector and Matrix.

@acer wrote:

I don't offhand see an easy way to use map[4] and the 'rtable' constructor while avoiding the extra layer of a custom operator (as in my revision above).

Here's a way that uses no non-builtin operator (I consider ArrayTools:-Alias as builtin since it's external code).

map(
     ArrayTools:-Alias,
     map2(rtable, 1..m*n, CartProd([[$0..p-1] $ m*n]), subtype= Matrix),
     [m,n]
):

And it makes a significant time improvement, I think.

I realized before you posted that it was the call to Matrix that was killing my timing. Matrix is a bloated 200-line Maple-language procedure.

Joe: The timings for Iterator are impressive, especially when the output is used in Iterator's native rtable form. I've only previously timed it using the output in list form.

First 527 528 529 530 531 532 533 Last Page 529 of 710