Carl Love

Carl Love

28065 Reputation

25 Badges

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

MaplePrimes Activity


These are answers submitted by Carl Love

Your expression for the integrand has unbalanced parentheses. I think you're missing a left parenthesis "(" at the very beginning. Once you repost a correction, I might be able to help you more. But I think that it's unlikely that you will get a symbolic answer.

The command is plots:-listcontplot(M, contours= [$1..20]). But you need to lay out your points in a grid form, which involves some sorting and approximating. I vaguely recall seeing a tool for this a many years ago. I will look for it.

Does the error occur in CalculateMatrix or after? Put a print statement after the CalculateMatrix call to find out.

It is a system of linear equations. It would be much more efficient to solve it with matrix operations (i.e. LinearAlgebra:-LinearSolve). Would a floating-point solution be acceptable? That would use much less memory.

You can convert the arrows, or anything else, to Cartesian coordinates, and put them on a polar plot like this:

 

N:= 12:

magnitude:= RandomTools:-Generate(list(float(range= 0..1, method= uniform), N)):

phase:= RandomTools:-Generate(list(float(range= 0..360, method= uniform), N)):

A:= < < magnitude[] > | < phase[] > >:

ExcelTools:-Export(A, "C:/Users/Carl/desktop/data.xls"):

A:= convert(ExcelTools:-Import("C:/Users/Carl/desktop/data.xls"), Matrix):

Convert to radians:

A[.., 2]:= evalf(Pi)/180 *~ A[.., 2]:

Polar to Cartesian converter:

xy:= P-> < P[1]*cos(P[2]), P[1]*sin(P[2]) >:

p1:= plots:-arrow([seq](xy(A[k,..]), k= 1..N), shape= arrow, color= red):

Dummy plot to give us the polar background:

p2:= plots:-polarplot(1.1*max(A[.., 1]), color= white, transparency= 1):

plots:-display(p1,p2);


Download polarplot.mw

Use Sum (with a capital S), instead of sum, and you will get the answer that you expect.

I have no idea what that escaped variable _O and the rest of that huge mess represents. Surely the result of differentiating the lowercase sum is a bug. However, I will note that the fault lies with sum, not diff, because you get a nearly identical mess if you just do the derivative in your head and enter

sum(sin(theta[j](t))*cos(theta[j](t))*diff(theta[j](t), t), j= 1..i-1);

It looks like your Alphabet is shifted by one. I get "Y"=58, "e"=70, "s"=84. Regardless of that, the encryption steps are the same. The essential command is the inert modular exponentiation operator x &^ e mod n. I also did the decryption, partly for to verify the encryption and partly for my own amusement.

with(StringTools):
Alphabet:=cat(Select(IsPrintable,convert([seq(i,i=1..255)],bytes))):
AlphaToNum:= table([seq](Alphabet[k] = k, k= 1..length(Alphabet))):
plaintext:= "Yes":
NumText:= [seq](AlphaToNum[c], c in plaintext);
                          [58, 70, 84]
n, e:= 119, 7:
Crypted:= (c-> c &^ e mod n) ~ (NumText);
                         [114, 77, 84]
To decrypt:
f:= ifactor(n);
                            (7) (17)
phi:= expand(map(x-> x-1, f));
                               96
d:= 1/e mod phi;
                               55
Decrypted:= (c-> c &^ d mod n) ~ (Crypted);
                          [58, 70, 84]
cat(seq(Alphabet[k], k in Decrypted));
                             "Yes"

Save your file in Excel. I think as a CSV file would be best (Comma-Separated Values). Then in Maple, give the command ImportData(); and follow the dialog. Once you get that done, post a followup to this, and we can proceed with the plotting. Also post a followup if you have any trouble with the dialog.

mrmathexpert wrote:

How can I control the specific regions that I want to highlight? For example, from pi/2 to 3pi/2: outside or the left side of the y-axis bounded; and from 3pi/2 to pi/2, outside or the right side of the y-axis bounded.

You can do the left side and the right side separately, each side consisting of two polarplot commands, and paste all four together with display. I'm not sure if this is what you were trying to describe:

p1:= plots:-polarplot(2+cos(x), x= -Pi/2..Pi/2, color= red, filled= [color= yellow]):
p2:= plots:-polarplot(2+cos(x), x= Pi/2..3*Pi/2, color= red, filled= [color= white]):
p3:= plots:-polarplot(2, x= Pi/2..3*Pi/2, color= blue, filled= [color= yellow]):
p4:= plots:-polarplot(2, x= -Pi/2..Pi/2, color= blue, filled= [color= white]):
plots:-display([p4,p2,p3,p1]);

Download polarplot.mw

Note that the order of the plots in the display command matters: They are printed in the reverse of the order that they appear in the command. I don't think this is documented.

GraphTheory:-Graph vertices need to be integers, symbols, or strings; arbitrary expressions are not allowed. So 2, `*`, function, cos, y, and z are valid; but 2*y, 3*z, and cos(x+2*y) are not.

The command that you want is subsindets (or possibly evalindets). Here's an appropriate analogy: subsindets is to indets as applyop is to op.

I think you should collect like terms with respect to the integrals, like this

collect(eq2, Int);

so that each specific integrand only occurs once.

Tell me exactly which integrands you are trying to select. You said "like" phi[i](y)*diff(w(y), y). Do you mean exactly that integrand? Or would phi[i](y)*diff(w(y), y)^2 also count as "like"?

Once you answer that, I can give you a type specification that you can use with subsindets.

Assuming that those square brackets are really there (which I find a bit strange), the command is

(op@eval)(w1(x), op ~ ([sol]));

and likewise for w2(x).

If the square brackets are not actually there, then change (op@eval) to simply eval in the above command.

If the square brackets are really there, you should post the commands that got you to that point, because there may be something wrong.

There must have been a syntax change between Maple 13 and Maple 17 that I am not aware of. So sorry about this. Try this please: Make your first command

kernelopts(opaquemodules= false);

I am not sure that will work.

Joe Riel (or any expert who can answer): Was it once true that only module exports could be accessed with thismodule, but now locals can be accessed thus also? Also, were keyword parameters introduced after MAPLE 13?

 

restart;

macro(RV= Statistics:-RandomVariable, P= Statistics:-Probability, N= Normal):

x:= RV(N(6.05, sqrt(.0004/9))):

P(x < 6.035);

HFloat(0.01222447265504615)

Z:= RV(N(0,1)):

P(Z < -2.25);

HFloat(0.012224472655044694)

 

Download StatsZ.mw

Use < p > for handy Vector-to-Matrix conversion, and use ^%T for transpose.

KroneckerProduct(< p >, < p >^%T);

Your worksheet shows that you got an answer in slighly less than a minute. And I ran your code and got an answer in about 90 seconds.

First 380 381 382 383 384 385 386 Last Page 382 of 395