Mac Dude

1551 Reputation

17 Badges

12 years, 129 days

MaplePrimes Activity


These are replies submitted by Mac Dude

@roussea18u Glad to have been able to help :-).

M.D.

@ 

The error msg. indicates that you put in the word "Matrix" for the name of the Matrix to be exported. You need to use the name you assigned your Matrix to, like this:

M:=Matrix(<seq(<x|x^2>,x=1..10)>);

ExportMatrix("Filename.txt",M,delimited, delimiter=" ");

Please read the docs for ExportMatrix; it is all in there. And remember that to Maple, Matrix and matrix are two different things; you want Matrix.

You get non-integer entries by transforming your index variable (which has to be integer to properly index into the Matrix). One way to do this is, e.g., to let n go from 1 to 100 and then define a function

xf:=n -> a*n+b;

where you replace a and b with the numbers you need to get the range in x you want. You then use xf(n) in place of x in the above constructor for your Matrix M. There are several ways to achieve the same thing but this seems a straightforward one.

M.D.

 

 

@Roby03 Ok, first: I overlooked that eq. 2 of your system also has diff(n,t) in it. So now I replaced that one as well with the third element. I ask pdsolve to solve only for c and v; this would leave us with some differentials of n vs x. At any rate, pdsolve now is working hard and has not returned with a solution yet, in fact it has gobbled up all the memory and I just had to stop it (as I am doing something else on this machine also and cannot afford it to become unresponsive). I am posting my sheet with both the incomplete solution and the failed attempt. The incomplete soltion has partial solutions that may or may not be of use to you.

In this generality this seems like a tough nut to crack. If you have any partial solution, or guess, already I'd suggest you use that and see how far you can get.

M.D.

 test.mw

 

@Roby03 In your list, sis[2] is

which is missing the "=0" that makes it an equation. pdsolve still won't solve this.

But you can use sis[3] to replace diff(n,t) in sis[1]) and pdsolve for c and v. That comes up with a lengthy solution I may post later but you should easily get for yourself.

M.D.

 

@TomM You are absolutely right about the need for another program to rotate the graphics and saving the rotated graphics. On Mac OS X I use GraphicConverter for this (allow opening the Clipboard image directly).

M.D.

@roussea18u No, this would assign a whole array to z[t+1].

You do

z:=Array(1..N,datatype=float);

Note that N has to be defined before this works,. so you do this >after< you have set N. Also note the capital A in Array.

2-D Arrays are the same:

z2d:=Array(1..N,1..M,datatype=float);

 

M.D.

 

@ecterrab Hi Edgardo.

This problem is also present in Maple 17 (and maybe earlier, haven't checked yet).

Is there any chance that one can update earlier versions of Maple with this fix? I assume the updated package you refer to won't work as is on earlier versions of Maple. To be concrete: I am interested as far back as Maple 15 which is the last version that runs on OS X on a PPC Mac.

M.D.

@acer This very helpful. I am doing a lot of work in Maple 17 still, some of it even in Maple 15 so some of your constructs won't work there. But I do have access to Maple 18 so I can always use that for such plots.

Thanks,

M.D.

@zippo Unfortunately I do not know how to move the graphics in the plotwindow.  If I have time today I'll see if I can find out.

M.D.

@Alejandro Jakubi You are correct about the function definition, although I would discourage using that kind of construct. My point was more that, in 2-D input, it seems to me one can do what the OP wants. Maybe he is mixing 2-D and 1-D input; which Maple allows but which I have found to be a source of great confusion (in part due to the 2-language issue you mention).

What I find works best is to use 1-D input for all "real work" where the results matter and 2-D for times where communication is the primary goal, but then stick to it. E.g. I wrote a script for a graduate course I held recently in Maple, which I did exclusively in 2-D document mode so I could use standard notation as much as Maple would allow me to do (which goes actually quite a long way). Parenthetically, from re-reading older posts here I take it that usage like that was one of the motivations for 2-D input in the first place. Makes sense even if we like to quibble with the actual implementation.

M.D.

@fhqtmso I find in 2-D Math mode:

     6

This behaviour is as expected, except that Maple actually put in the unevaluation quotes. I can even say

     

So it is not clear where the problem lies. Note that in Maple you do not define a function by saying something like De(t,z):=...

M.D.

 

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.

First 24 25 26 27 28 29 30 Last Page 26 of 42