Carl Love

Carl Love

28050 Reputation

25 Badges

12 years, 335 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@mmcdara Hmm, yes, of course. This was the first approach that I tried. I hope that you realize that my approach does linearize the problem automatically, uses exactly the same computational engine as yours, and produces exactly the same result. The reason that I didn't publish that first approach is that it requires manually taking apart the model function and re-entering parts of it into the code. The essence of elegance in programming is to reduce such redundancy. The goal is to enter the problem into the computer in as close a form as possible to its original statement and then to avoid, as much as possible, re-entering any subparts.

I do appreciate that your code shows a shortcut that I was previously unaware of: The tilde ~ can be placed after a function symbol (in prefix form) to zip that function as well as to map it. To wit: You used TX~(x,y) as a shortcut for zip(TX, x, y). I've already used that new knowledge twice in the few hours since I read your code.

@Vic It's often quite difficult to parallelize code, but in this case it's very easy, almost trivial. Make a list of lists LL such that each member of LL is one of the lists that you want to process and such that LL is as long as can comfortably fit in the memory of your computer. I'd guess that LL has on the order of a million members. Then simply do

Threads:-Map(ListProcess, LL);

@Adam Ledger Since you seem to like commands that are as short as possible, like I do, I thought that you'd appreciate that the pairing of the data could be done by `[]`~(X,Y)

Do you mean that you'd like a procedure that'd check whether the span of a set of vectors U is in the subspace spanned by a set of vectors V? What you're calling u and v are not usually thought of as single vectors as you are suggesting. Rather your u is the span of {<0,1,0>, <0,0,1>} and your v is the span of {<1,0,0>, <0,1,0>, <0,0,1>}. 

Thank you Preben and Acer. I guess that the problem has something to do with the package that I'm testing. The instructions for loading the package are quite complex, which is why I didn't mention it before. I'll post full details on loading the package later.

I'm also getting an error from exprofile, but not a "kernel connection lost". The error is "invalid nesting of calls and levels".

@krismalo That should be *~ rather than ~*.

@Markiyan Hirnyk Thank you.

I think that the term "p-value" is nearly universal (well, I only know about English language) for this concept. Do you think that this would be a suitable replacement for P(>|t|)?

@taro Let me know if you need any further explanation. I thought that sort(..., key= ...) was the year's best new feature for whichever year it was added---Maple 18 I think.

@tomleslie I think that the problem is that isolating R/R[0] results in a much more complicated expression, with an especially nasty looking RootOf. This explains why the plotting is slow---there's an fsolve required for every point. It doesn't explain the inaccuracy. But it looks like some catasthropic cancellation may be occuring.

The lesson is that you should trust implicitplot: It's a very fast and usually very accurate command suitable for almost any relation between two variables. If you read its help page, I think that you'll see at least that it's well designed.

@taro My command is easy to study by taking it apart like this:

indets(hh);
%[];
[%];
`[]`~(%);
map2(solve, hh, %); #These are all possible substitutions.
select(s-> nops(s)=1, %); #These are the 7 injective substitutions.
op~(%);
map2(eval, nb, %);
simplify~(%);
sort(%, key= length);
%[1];

@fatyplus Is it appropriate to assume r > 0? Then does the following give you what you expect?

Y:= evalc(f1*(Re(Z)+Re(diff(Z,x)))+f2*(Im(Z)+Im(diff(Z,x)))) assuming r > 0;

f1*(cos((1/2)*x)*A0/r^(1/2)+cos((1/2)*x)*r^(1/2)*A1+cos((3/2)*x)*r^(3/2)*A2-(1/2)*sin((1/2)*x)*A0/r^(1/2)-(1/2)*sin((1/2)*x)*r^(1/2)*A1-(3/2)*sin((3/2)*x)*r^(3/2)*A2)+f2*(-sin((1/2)*x)*A0/r^(1/2)+sin((1/2)*x)*r^(1/2)*A1+sin((3/2)*x)*r^(3/2)*A2-(1/2)*cos((1/2)*x)*A0/r^(1/2)+(1/2)*cos((1/2)*x)*r^(1/2)*A1+(3/2)*cos((3/2)*x)*r^(3/2)*A2)

@nidojan Thank you. Calling it a workaround makes it seem as if there is a bug or as if display wasn't the intended way to do it. There isn't a bug, and using display is the official, designed way.

All attached worksheets are read only. There is no problem. It just means that you need to change the name if you want to save it after modification.

I see that you keep bumping this Question to the top of the stack. Please don't change the Products list in the header again, unless it's to select your version of Maple. Your Question is about Maple alone; checking off other boxes is disrespectful.

I think that your problem is too general to be solved by a little bit of Maple code. Perhaps it could be the subject of a whole package with hundreds of lines of code. In particular, your iteration requires as an initialization the solution of a PDE, and it requires two indefinite integrations at each step. These are difficult things even in specific cases, let alone with the generality that you specify here. After the PDE and the indefinite integration are handled, the rest of your iteration is straightforward.

@Markiyan Hirnyk 

It's just a triviality based on the random function used, which should have no effect on the OP's problem. However, by randomizing the initial point (away from the default (0,0), which is likely a critical point), the example can be improved. I updated the code to do this, so please try again.

I have no idea where all that Typesetting junk that you show comes from. Let's see if it goes away. If not, try 1-D input.

First 391 392 393 394 395 396 397 Last Page 393 of 709