Mac Dude

1576 Reputation

17 Badges

14 years, 212 days

MaplePrimes Activity


These are replies submitted by Mac Dude

Thanks all, Carl, Markiyan and itsme. I am quite sure one or all of these will do what I want.

(To Markiyan: I asked about listdensityplot as that one has a smoothing option which I will likely want to employ. Chances are that surfdata has or does that as well (the image you posted suggests that). At any rate, if I can get your transformation scheme working for me then that is what I'll use as it probably lets me use any command).

M.D.

@J4James This de actually looks somewhat similar to the equation of a plane electro-magnetic wave in a circular waveguide.

As others already said, _C1 (the coefficient of BesselY(0,0)) should be 0 else you end up with an infinity at r=0. Of course this holds only if indeed you need defined behaviour of the solution at r=0... your choice for the initial conditions indicates that you do.

For such equations, you find _C2 (the coefficient of BesselJ(0,0)) from the value of the solution on the axis (r=0); here we have w(0)=_C2. Note that your solution should not be w(0)=0 as that is the trivial solution (w(r)=0 for any r).

For given values of the other parameters this defines your solution. As you found out, diff(w(r),r) is not useful here as it is 0 at r=0 (once you got rid of the BesselY term). Note that this is a mathematically valid solution for sure, even if it may not be the one you are looking for.

You may also want to know r for w(r)=0. (In the wave equation this would be the boundary condition at the radius of the waveguide). This is tricky here as you have the other terms besides the BesselJ term and Maple cannot solve this directly. fsolve can possibly be coerced to give you a solution but would need values for the various parameters. You can also try a series expansion and get an estimate for the 0 crossing of w(r) (I'd try 2nd order (3 terms in series()) first).

All of which begs the question: What kind of system is your de actually describing? If this describes a physical system you can probably glean the correct initial conditions from that.

M.D.

@Guoqiang Du You have to consider what you are doing here. If you replace n1+n2 with 1; then in fact you can no longer use n1 and n2 independently. n1 then IS 1-n2. Or, likewise, n2 IS 1-n1. If you use n1 and n2 independently after the substitution of n1+n2 by 1 and they do not add to 1; you are being inconsistent and you are making a mistake.

You can consider freezing the expressions if the n1 and n2 in your case are very complicated and you want to maintain the structure:

subs(subexpr=freeze(subexpr),expression); # use algsubs if subs does not work

.

.

.

thaw(expression);# to unfreeze all frozen expressions.

M.D.

I take your indication that "with(yourPackage)" works and some procs in the package work as sign that the option package statement is there and the .mla file is where Maple can find it.

The with() statement returns the list of exports from the package; are the procs that don't work in there? If not then they are not exported and you need to include them in the sequence of exported names. If so, then try to print the proc to see what parameters you need to supply.

If this does not help, please upload the package.

M.D.

@mehdi jafari The data file I downloaded (NLIST.txt) has extra (blank) lines at the end that trip up ImportMatrix. Get rid of those and it works.

M.D.

This is of course a rhetorical question. Dirac's delta cannot be plootted directly as only its integral is defined.

You can evaluate and plot its Fourier transform (well, the real and/or imaginary part anyway). It gives a line spectrum unbounded in frequency (not unexpectedly so). If you transform back you may be able to get an approximation of your delta functions that in fact can be plotted.

Mac Dude.

 

You define the function like this:

f:=r_ -> Int(Int(Int(G(r_-r0_)-(x_-r0_)*rho(r_))));

however, you also need to specify the differential to integrate over (2nd argument of Int()).

Mac Dude

@Alejandro Jakubi Thanks; I had forgotten about assume creating local names.

I hope the OP reads Markiyan's and your comments as they allow her/him to complete checking the solution

M.D.

I ran your system and did not get anywhere, just an mserver process (the Maple compute engine) chewing up increasing amounts of memory (ca. 15 min when I killed it).

In cases like that I normally try to find partial solutions using a subset of the whole set of equations. These can be used to reduce the number of equations/variables. The "eliminate" command may help, although I usually just solve repeatedly, then substituting the solutions to get rid of variables. It is a bit tedious in your case but you'll find out where Maple chokes.

I don't typically try to solve such large systems. with smaller ones (3 to 4 eqns) it takes seconds at most.

Mac Dude

 

I ran your program up to the point where your post indicates an error (solve(sys1[][]...). No error occurred for me in Maple 15. The solutions are not particular meaningful but that is presumably a different issue.

Are you beginning each worksheet with restart; ?? If Maple acts funny, recalculating the whole sheet is the first line of defense; the restart flushes most of the previous garbage.

It would be nicer if you could upload worksheets to spare us copy-pasting line by line.

M.D.

 

 

It is not clear that your problem is posed in a way we can help; but here are some suggestions to maybe help clarify the issue:

At the very first: If this is part of research work, you should worry about it! Actually, rather than worrying, double/triple/quadruple check your results. Apply common sense. Put results back into the original eq. Etc.

As for Maple 12 vs Maple 15: It should be no surprise that you get different results (after all, Maple is evolving and you switch between 3 generations). It seems Maple 15 finds solutions that Maple 12 does not: this would be consistent with an upgrade of the relevant routines (solve in this case). The question you need to assess is: is one solution correct and the other wrong? You are indicating sign differences to another program: with eigenvalues of a 3 by 3 matrix I am not shocked about that: Eigenvalue equations have multiple solutions and it is possible that different programs pick different branches. Your understanding of the original problem should help you to pick the sign that is right (or you have multiple valid solutions). Do any of your solutions make sense?

Also note that different versions of Maple may present results (esp. multiple results that are stated as lists or sequences) in different order. This can trip you up when using, e.g., op(n,xpr) to pick a certain one.

You appear to do eigenvalues "by hand": what do you get from straight usage of Maple's eigenvalue/eigenvector routines in LinearAlgebra?

My own experience is that Maple actually makes few outright mistakes. However, there are many cases where Maple output may omit solutions I am looking for; or present a multitude of solutions and I get to decide which is physical (most of my problems are physics-related). And there are cases where Maple does not find a solution I know exists. And there are cases where Maple leads me to a deeper understanding as it shows solutions I did not know existed.

If you upload a worksheet, maybe we can have a look.

Mac Dude.

@Markiyan Hirnyk It may not be a surprise that ExponentialFit returns a higher rms deviation that DirectSearch or NonlinearFit. The linearization that ExponentialFit does will lead to a bias unless the underlying linear fit is done weighted with the weights properly calculated from initially given weights (even if those are all 1). The docs on ExponentialFit are mute on this subject, except the docs seem to say that user-supplied weights apply to the linearized data and not to the original data.

Mac Dude

@Christopher2222 

restart will not gc or deallocate Java memory, so no surprise that the Maple.exe process memory does not change.

Java has an incremental garbage collector that you can activate with -Xincgc. By default that is off. Maybe that would help (I have not tried that yet). You would put that switch on the same line as where the -Xmx is (and there don't seem to be any arguments to -Xincgc).

Your temporary freeze upon resizing is not a surprise. Is mostly an issue with 3-d graphs for me. It usually clears up with patience.

You can also add a stack-size increase. -Xss4m (or maybe 8m) will likely double or triple your Java stacksize which on general grounds I would assume should be a certain fraction of the heap (but I really have no deep knowledge here).

M.D.

@Alejandro Jakubi 

Right, and the options I have seen and now modified on my system are -Xmx (max heap) and -Xss (stack). I guess the issue for christopher is now where these actually are set in Windows (the file jre\bin\client\Xusage.txt you mention seems to be more like a help file than a file used by the system to set the parameters).

I have not had a chance to push this so I still don't know how much help it'll be.

M.D.

@mehdi jafari 

It is interface(imaginaryunit), at least in Maple 17.

M.D.

First 25 26 27 28 29 30 31 Last Page 27 of 43