acer

33193 Reputation

29 Badges

20 years, 211 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@quoteswindy0 

In Maple you assign some value to a name using  :=  not just the = symbol.

I deleted it, as a duplicate of the earlier Question's line. I used the particular moderator facility with the drop-menu item labeled "Duplicate".

I had previously politely asked the submitter (twice) to stop posting separate duplicates of the thread, and instead to add any additional details or followups in the earlier thread.

At least one other duplicate of the thread had been previously deleted (and accompanied by the mentioned kind of request).

Please don't repost this in additonal, separate Question threads.

Instead, please put your followup queries and additional details in Replies/Comments in this thread.

Please put your additional details on this problem here, instead of in a separate Question thread.

@lcz The attached worksheet has code in its Startup Region which alters some GraphTheory routines. Hopefull it'll let you pass that stylesheet spec along to the interactive facility, as well as the earlier change to allow a Matrix/Table of interactive graph renderings.

I put it in a conditional to test for Maple 2021 or 2022, as I don't know whether the code edits are valid in other versions. It relies heavily on particular forms of the procedures (though I didn't put in a flag to prevent anyone accidentally rerunning the initial editing process twice).

GTinterstyle.mw

How large (typically) is Matrix A, and how fast do you need it to be?

Does Matrix A have special structure, eg. symmetric (real), etc?

Do you also need to optimize for doing this computation very many times for modest size?

@ijuptilk In versions 18 (and older) of Maple you would have to apply the evalf command to get arithmetic involving Pi and floats to produce a float result by default. Eg,

p[1] := evalf( 38.01/(Pi^2*(1-1.31/Pi)) );

Imagine the time that could be saved if you had bothered to inform us as to your specific old Maple version.

@ijuptilk When you submit a Question on Mapleprimes you should mark it with the specific version that you are using.

You can do that using the "Product" drop-menu, when editing/composing the Question.

If you don't bother to do that then we cannot tell whether you have a version that supports all the latest functionality.

If your version doesn't support the option maxsols = 200 for the Calculus1:-Roots command then see what happens when you omit it. It might still be adequate for your needs.

@mmcdara Yes, they're quite different from each other.

That use of Typesetting:-Suppress affects how f(x) is pretty=printed in 2D Output in the Standard Java GUI (ie, typeset). But it doesn't relate to the plaintext input I type on my keyboard. It has the effect that the call f(x) is pretty-printed as just f, in 2D Output.

But alias(f=f(x)) does other things. For example,

restart;
alias(f=f(x));

                f

eval(f, x=3);

               f(3)

So that has changed what happens when I input the name f. And the way the call alias(f=f(x)) works can depend on some prior assignment.

@nm Having a shared engine (kernel) would be best illustrated by a value of some assigned name in one sheet affecting the same name in other sheet. The problem you describe with "restart" may (or may not) be due to the very same thing.

How is it functioning for you? Are you seeing the behaviour of distinct kernels (engines) across worksheets? Or are you seeing collision amongst assigned names and state, between worksheets?

@mnovaes The first argument passed to subs, ie. x=4 , is evaluated up front and becomes 3=4 even before the subs command receives it.

restart;

x := 3;

            3

trace(subs):

subs(x=4, 3);

 execute subs, args = 3 = 4, 3

            4

# Compare with, say,

subs('x'=4, 3);

 execute subs, args = x = 4, 3

            3

@mmcdara I suppose (hope?!) that this is all about interactive use, in which case alias is often useful and I don't object to it. If it works for you, then that's great.

I tend to look at things in a more programmatic perspective, in which I prefer not to assign to names which I still want to use as if they were unassigned. I suppose my preference is for approaches that work reasonably in both interactive and programmatic scenarios, where "reasonably" often has a connotation of scaling efficiently (as well as being straightforward to program).

@biol Do you mean something like this?

Or do you want to proceed the other way (formulaically), starting with an odd number and computing an even square that might be subtracted?

If it's homework/assignment/coursework, then how much of this do you think your ought to figure out yourself?

restart;

interface(typesetting=extended):

seq( seq( print( (2*j+1 + (2*n)^2 = (2*j+1 %+ (2*n)^2))
                 = 2*j+1 %+ (2*n)%^2 ),
          j=0..4*n+1),
     n=1..3);

(5 = `%+`(1, 4)) = `%+`(1, `%^`(2, 2))

(7 = `%+`(3, 4)) = `%+`(3, `%^`(2, 2))

(9 = `%+`(5, 4)) = `%+`(5, `%^`(2, 2))

(11 = `%+`(7, 4)) = `%+`(7, `%^`(2, 2))

(13 = `%+`(9, 4)) = `%+`(9, `%^`(2, 2))

(15 = `%+`(11, 4)) = `%+`(11, `%^`(2, 2))

(17 = `%+`(1, 16)) = `%+`(1, `%^`(4, 2))

(19 = `%+`(3, 16)) = `%+`(3, `%^`(4, 2))

(21 = `%+`(5, 16)) = `%+`(5, `%^`(4, 2))

(23 = `%+`(7, 16)) = `%+`(7, `%^`(4, 2))

(25 = `%+`(9, 16)) = `%+`(9, `%^`(4, 2))

(27 = `%+`(11, 16)) = `%+`(11, `%^`(4, 2))

(29 = `%+`(13, 16)) = `%+`(13, `%^`(4, 2))

(31 = `%+`(15, 16)) = `%+`(15, `%^`(4, 2))

(33 = `%+`(17, 16)) = `%+`(17, `%^`(4, 2))

(35 = `%+`(19, 16)) = `%+`(19, `%^`(4, 2))

(37 = `%+`(1, 36)) = `%+`(1, `%^`(6, 2))

(39 = `%+`(3, 36)) = `%+`(3, `%^`(6, 2))

(41 = `%+`(5, 36)) = `%+`(5, `%^`(6, 2))

(43 = `%+`(7, 36)) = `%+`(7, `%^`(6, 2))

(45 = `%+`(9, 36)) = `%+`(9, `%^`(6, 2))

(47 = `%+`(11, 36)) = `%+`(11, `%^`(6, 2))

(49 = `%+`(13, 36)) = `%+`(13, `%^`(6, 2))

(51 = `%+`(15, 36)) = `%+`(15, `%^`(6, 2))

(53 = `%+`(17, 36)) = `%+`(17, `%^`(6, 2))

(55 = `%+`(19, 36)) = `%+`(19, `%^`(6, 2))

(57 = `%+`(21, 36)) = `%+`(21, `%^`(6, 2))

(59 = `%+`(23, 36)) = `%+`(23, `%^`(6, 2))

(61 = `%+`(25, 36)) = `%+`(25, `%^`(6, 2))

(63 = `%+`(27, 36)) = `%+`(27, `%^`(6, 2))

Download odd_stuff2.mw

First 126 127 128 129 130 131 132 Last Page 128 of 607