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

Please supply the code for function f. If I change your f to something simple like 1, then I do not get white lines.

Do the white lines appear on the plot in the worksheet? Or do they only appear after you've transferred the plot somewhere else?

The order of terms in some expressions such as polynomials is not fixed in Maple. However, if you apply the sort command to a polynomial, then the order (and hence the operand numbers) are definite.

For a more detailed analysis of your situation, please post your code in plaintext form or as an attached worksheet.

When I enter your code like this, I have no problem.

Vp:= [bF*F*(1-F/kF)+mu*FI,
     bv1*V1*(1-V1/kV1),
     bv2*V2*(1-V2/kV2), 0, 0, 0];

VectorCalculus:-Jacobian(Vp, [FS, V1S, V2S, FI, VII, V2I]);

But there must have been some preliminary code that you had. Otherwise the Jacobian is trivial because your expression Vp doesn't contain the variables FS, V1S, V2S, VII, or V2I.

So, please post your complete code in plaintext form or as an attached worksheet so that I don't have to retype it.

Please post the code that generates the Matrix. At first glance it looks like the problem is possibly that you are using lists instead of Vectors or Matrices.

@Markiyan Hirnyk Okay, yes, I converted the general formulas for slope and tangent line from Cartesian to polar. But I did not use Cartesian coordinates in the way that the OP objected to: I did not convert anything from polar to rectangular, and I plotted the line in polar.

The OP wrote:

How can I avoid having to convert everyting to rectangular coords, and plot the tangent line in polars?

 

The first answer that Maple gave you is not really wrong. It is an indeterminate form: 0*infinity. That just means that it will take more work to get the answer. Using combine or another simplifier is the best thing you could do.

@Markiyan Hirnyk Do you doubt that that's the tangent line in vector form? T[2] is equivalent to the OP's expression for the tangent line.

@casperyc

Exchange the roles of newdata and data, and then you only need one change in your code at the top. But call it something sensible like data_name:

mysum:= proc(data_name::evaln(list))
local
       data:= eval(data_name)
,
#
# other locals stay the same
#

;
#
# rest of code is exactly the same
#
end proc:

@mahmood180 You see, these comments get lost and forgotten if you don't Post them as separate Questions.

@mahmood180 Please post this as a separate Question. And we can't answer "Is this the right one?" unless you also post a problem with the putative answer.

@Joe Riel You wrote:

Suppose you are creating m lists, each with n elements and collecting them into a set. Assume all lists are different. With Maple's approach the cost of this, I think, is O(m*n)

Sets are stored sorted in Maple, not just hashed, so there are logarithmic factors involved; so, O(m*ln(m)*n), assuming an optimal sorting algorithm. A logarithmic factor is only a small difference though.

@AM So, you see that the question has been answered, right? In modern Maple:

S:= {parse(cat(convert(M^%T, list)[]))};

And for earlier Maple, follow the solution of Kitonum.

Showing explictly what each step does:


M:= < 1,1,1 ; 2,2,2 ; 3,3,3 >;

M := Matrix(3, 3, {(1, 1) = 1, (1, 2) = 1, (1, 3) = 1, (2, 1) = 2, (2, 2) = 2, (2, 3) = 2, (3, 1) = 3, (3, 2) = 3, (3, 3) = 3})

M^%T;

Matrix(3, 3, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 3, (2, 1) = 1, (2, 2) = 2, (2, 3) = 3, (3, 1) = 1, (3, 2) = 2, (3, 3) = 3})

convert(%, list);

[1, 1, 1, 2, 2, 2, 3, 3, 3]

%[];

1, 1, 1, 2, 2, 2, 3, 3, 3

cat(%);

`111222333`

parse(%);

111222333

{%};

{111222333}

 


Download parse_matrix.mw

@JVLB You asked:

So there is no way to speed this up?

You can try the Grid package, which is analogous to Threads, but does not use a shared-memory environment. Since the initial memory state needs to be copied to all processes, Grid is slower and uses more memory than Threads.

Or can I sort of create my own "Map" procedure which creates threads explicitly?

It still wouldn't work if you're using non-thread-safe code.

Why are they not thread safe? Do they internally use the same memory space (or global variable) to store intermediate results?

Yes, exactly.

(in which case manually programming a "Map" procedure would not work either)

Correct.

@Kitonum Thanks for pointing this out. The problem can be overcome more directly by taking the Transpose of M.

Note that map(rhs, convert(op(2,M), list)) only works for this particular Matrix. It will definitely fail for any Matrix with a 0 entry. Zero entries are not represented in op(2,M).

Do you think that many readers here understand "average BER for BPSK"??? Please post your complete code or attach a worksheet.

First 529 530 531 532 533 534 535 Last Page 531 of 709