acer

32333 Reputation

29 Badges

19 years, 323 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Please stop posting separate and duplicate Question threads for this example.

If you encounter additional syntax problems (2dmath, etc) then please put them in Comments/Replies here, instead of spawning entirely different Question threads.

Perhaps you are trying to obtain the following:

restart

with(plots)

a := 1

1

r := proc (phi, B, theta) options operator, arrow; sqrt(-B^2+(a^2+B^2)*cos(theta)^2)*f(sqrt((-B^2+(a^2+B^2)*cos(theta)^2)/((a^2+B^2)*cos(theta)^2))*(phi-sqrt(a^2+B^2)*cos(theta)*arcsec(a/sqrt(-B^2+(a^2+B^2)*cos(theta)^2))/sqrt(-B^2+(a^2+B^2)*cos(theta)^2))) end proc

proc (phi, B, theta) options operator, arrow; sqrt(-B^2+(a^2+B^2)*cos(theta)^2)*f(sqrt((-B^2+(a^2+B^2)*cos(theta)^2)/((a^2+B^2)*cos(theta)^2))*(phi-sqrt(a^2+B^2)*cos(theta)*arcsec(a/sqrt(-B^2+(a^2+B^2)*cos(theta)^2))/sqrt(-B^2+(a^2+B^2)*cos(theta)^2))) end proc

f := proc (x) options operator, arrow; piecewise((-1)*Pi/2.2 < x and x < Pi/2.2, sec(x), Pi/2.2 < abs(x), sec(Pi/2.2)) end proc

proc (x) options operator, arrow; piecewise((-1)*Pi/2.2 < x and x < Pi/2.2, sec(x), Pi/2.2 < abs(x), sec(Pi/2.2)) end proc

polarplot([r(phi, 0, 0), r(phi, .48, 0), r(phi, 3, 0), r(phi, 4, 0)], phi = -2*Pi .. 0, color = [red, black, green, blue])

NULL

Download maple1.mw

What is the argument that is supposed to be passed to the f operator, inside the definition of the r operator? You have it as merely f, stand-alone. Is that supposed to be f(phi), f(theta), or...?

Also, check for missing multiplication signs. I detected a few.

I am unsure whether the brackets are all placed as you intend.

@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
First 110 111 112 113 114 115 116 Last Page 112 of 591