Mac Dude

1571 Reputation

17 Badges

13 years, 89 days

MaplePrimes Activity


These are replies submitted by Mac Dude

Not only is zeros[] undefined; you are also using n within the for i from... do loop without defining n. Should n be i??

As written, the output of the loop would just be listed and you'd have to plot "%" right after the closing "od", which seems a bit precarious.


Should "shanks" be a Vector?

Mac Dude.

@ Here is what I would do:

(frst and scnd are the expressions from your Maple worksheet)

U[int] is not zero for all t; but diff(U[int],t) can still be evaluated for all phi and all t, in particular for t = infinity:

limit(frst,t=infinity);

So frst can be 0 for infinite t only if phi=0 or Pi. If we plug phi =0 into frst we can look at different values for t:

simplify(subs(phi=0,frst));solve(%,[t],AllSolutions=true)[];

and find that t*90/Pi has to be an integer ≥0. (which is what _Z1~ is). in other words, you are looking at complete half-cycles (90 is the radial frequency omega, in your sheet). On close inspection that is what your plots are showing: for fractional cycles the flat spots (zero-condition for frst) shift slightly.

It remains to show that the 2nd derivative stays positive which can be trivially done by plugging in the above value for t. The value, for phi=0, of scnd becomes Pi*_Z1~/180, which is >0 for any t >0. For _Z1~=0 (=t=0) the behaviour is correct also: no curvature as at t=0 there is no accumulated difference regardless of phi.

You can do the math for phi=Pi and will find that scnd will become negative for t>0, i.e. you are looking at a maximum

So the condition of complete half-cycles (which follows from the long-time limit) allows to solve this problem also. I suspect removing that condition would make the problem very messy and maybe untractable except numerically. I have not tried that case.

M.D.

@Carl Love I won't argue with your assertion that lists work, but I had to do the convert to bring the data into a form that NonLinearfit would accept so I thought I'd hand that to the OP as well. Without the convert I got weird error msgs. Probably just ineptness on my part.

As for the initialvalues being all that is required: In my experience, specifying the fit parameters explicitly cuts down on a lot of stupid error messages. I usually do that before I spec. initialvalues as the latter is not always necessary. The message here is that nonlinear fitting algorithms are a bit finnicky and the user better know his/her problem well enough to specify these details and scrutinize the results for being sensible. And, by the way, I do not consider the observed behaviour (failure unless enough info is given to the algorithm) a bug. If it hangs, maybe (in my case it did not).

M.D.

@Axel Vogt This solution list is valid for t=1. If I understand the OP correctly, (s)he wants a solution for general t>0.

To the OP: The differential wrt. phi being 0 merely proves one has an extremum. It needs to be ensured that the 2nd differential is >0 to guarantee a minimum. For phi=0 and general t>0 this can be shown to be the case in a direct, straightforward manner (just do the differentiation wrt. phi & solve w/o assigning t; then do the 2nd diff for the first solution (t=0)) thus proving that phi=0 is a local minimum for all t>0. Showing that this is the only minimum (or the deepest one) is more complicated and is left as an exercise.

Mac Dude.

@Alejandro Jakubi It is an interesting command I did not know yet, but it does not do what I need. I need to be able to do something to some of the occurrences of q, but not others.

Thanks anyway,

M. D.

@Carl Love Yes, I did see it. Apologies for late reply, sometimes life gets in the way. I got sidetracked & aen't gotten back to this thing yet.

I actually was looking more for some function or proc that returns the operand numbers of the occurrences of q, maybe in a list, so that I can then do something to the occurrence I want to (e.g. using subsop). Your solution is cleverer in the sense that it looks for certain structures, I'll have to see whether that works also for the more complicated cases(or even better).

Thanks,

M.D.

@acer Oh boy, do I feel stupid now...:-)

But thanks; that is what I wanted.

M. D.

 

@Carl Love Well, as the name coeffs suggests, I expect the coefficient that these variables (x0 or xp0) are multiplied by. The coefficient can be a number, another name, or an expression. If either x0 or xp0 don't show up at all in the expression being tested (the rhs of X or XP), the coefficient of that particular variable is 0 and coeffs should return that.

In the specific example above I want 1 for coeffs(op(2,X),x0); and 0 for coeffs(op(2,XP),x0);.

Thanks,M.D.

@Carl Love Seems to work on my Mac, Ffx 23.01, Mac OS X 10.6.8.

The only real difference I notice is the spinner on loading a group of posts or replies.

Mac Dude

MapleCloud is an online storage facility for Maple worksheets. You can make them public, or keep them restricted or private. It allows you to have your worksheets available on other computers. It can also facilitate sharing of worksheets e.g. in an educational context.

If you search the Maple Help system for worksheet/cloud/overview you get a fairly comprehensive overview what it can do.

Mac Dude

This is a fairly comprehensive list. It shows a number of fairly recent books (2010 and newer) on Maple that I was not aware of.

Thanks much for pointing it out.

Mac Dude

 

@ANANDMUNAGALA This one is by Derek Richards and published by Cambridge press in 2002. I just recently found it in our library.

It is a graduate-level text with some interesting and more advanced subjects. 3 chapters of intro to Maple, beginning wih Chapter 4 it is mostly math and little Maple except for the exercises. Like many, it suffers from the problem of not being updated: Maple 6 is the latest version mentioned. So the newer Maple constructs are not covered.

I like the math it covers. I am not sure it really helps much with Maple as one seems to be mostly on one's own after the intro chapters. Some of the solutions to the exercises can still be found on the Internet (Google is your friend).

Mac Dude

 

@Lenin Araujo Castillo The book you refer to is a German undergraduate textbook. From what I could see it is quite comprehensive. I could not see any Maple-related content (but one only gets to see one or two pages per chapter). In fact; I saw some constructs that won't work in Maple as written, although others did have a Maple-ish flavor.

Mac Dude.

@Melykin Actually, TNBFrame() does allow you to control at least some aspets of the plot. Here are the options I am using to display a certain TNB frame (directly from a sheet of mine):

Student:-VectorCalculus:-TNBFrame(\
...
output=animation,range=0..214,frames=50,axes=boxed,\
                                   binormaloptions=[thickness=1,color=red],\
                                   tangentoptions=[thickness=1,color=black],
                                   normaloptions=[thickness=1,color=green]);

There are likely other options that work, too. In general, many options to plot and plot3d will work by being handed down to the lower-level routines.

Not arguing with your approach at all; just letting it be known that Maple can produce useful TNB frame plots & animations with relative ease.

M.D.

Melykin, you may also want to look at Student:-VectorCalculus:-TNBFrame() with the output=animation option. It creates in essence the same animated plot you show here. It is described in the help facility.

Mac Dude.

First 29 30 31 32 33 34 35 Last Page 31 of 42