itsme

769 Reputation

14 Badges

17 years, 182 days

MaplePrimes Activity


These are replies submitted by itsme

Thanks for your reply, but I already have a an expression that I want to act on - if i was just building it, then of course applying collect first would make sense.

 

using applyop is also not optimal for me, because I have to explicitly specify which operator i want to act on. For example this works:

a2:=exp(a0);

applyop(collect, 1, a2, [x, t]);

but this doesn't:

a2:=A*exp(a0);

applyop(collect, 1, a2, [x, t]);  #here clearly the '1' argument is incorrect.

Basically i have expressions with maybe 20 or more terms, each somehow containing an exponential (multipled by something or divided by something or... )  and i need to collect terms in all those exponentials.

So that's why the 'applyrule' command would be optimal - but not sure why it's not working.

 

So I now found this thread

http://www.mapleprimes.com/questions/42773-Argument-Extraction

which shows that one can use 'op, but in my case a rule would be much better, as it would automatically handle any algebraic expressions that multiply the exponential.

 

 

 

Thanks Alejandro. I will look into your approach.

I wasn't sure if a functionality like this is already somehow implemeted, but the thread you point out, confrims that it's not.

Thanks Alejandro. I will look into your approach.

I wasn't sure if a functionality like this is already somehow implemeted, but the thread you point out, confrims that it's not.

although, i would expect <n>=|alpha|^2  in Eq 7.

is there some unusual normalization that results in the factor of 4 in front?

@Carl Love ...yes - good call.

@acer

yes indeed - that is the case.

thanks!

@DSkoog

if these set plot sizes, were also respected when exporting the worksheets to pdf, that would be extra great! ;)

I might be slightly (aghem.... or maybe even not so slightly...) biased, as I work in physics, but outside of the core maple engine, I would consider this the coolest project Maplesoft is working on. Just by looking at the examples above, one can see the already present power, as well as all the potential to making it extremely useful for both students and researchers.

Well done Maplesoft for investing in this!

I have seen this before (it has been a problem since I think maple 15).

In linux, this happens if you:

1) open a file via command line with xmaple ./myfile.mw

2) go into a different directory

3) try to open another file via xmaple ./anotherfile.mw

I think Maple gets confused because it tries to use the "current working directory" which is internally set to be the directory of the first file that was open.

the work around is to simly provide the full path of the second file that is being open - so in (3) above if i do xmaple /full_path_to/anotherfile.mw things work ok.

 

I don't know exactly how you observe this, but my guess is that this you probably have maple already running. If so, you could open the new file from within maple (via file->open). Or just open by providing the full path (if you're opening via terminal)... 

 

You can write some code into a standard text file (but use the .mpl extension to keep with the convension) and then simply have maple execute it from within a document or worksheet with the "read" command. This lets you easily edit (possibly many) source files, and still take advantage of the "pretty math" maple produces for output.

i can confirm this in both maple 16 and maple 17.

it's a bug.

@Petra Heijnen

a way around it (that works for me) is to make sure in your file "runningmplfile.mw", you have the "restart" command in a separate execution group from the other commands (which call "read" especially).
It is actually documented (see docs for "restart") that it should only ever be ran on its own - and when it shares it's execution group with other commands the behavior is undefined.


 

@Petra Heijnen

a way around it (that works for me) is to make sure in your file "runningmplfile.mw", you have the "restart" command in a separate execution group from the other commands (which call "read" especially).
It is actually documented (see docs for "restart") that it should only ever be ran on its own - and when it shares it's execution group with other commands the behavior is undefined.


 

@Mac Dude 

Looking at your history, it seems like you're not a new to maple, so maybe I am missing something. Why do you need to use "use" at all?

if you want local binding and have divided your code into functions, then can use "local" to declare variables that have only function specific scope. 

If you don't have many functions, have many variables, but do not want to give them numerical values right away (this happens in my work all the time), than can use the "subs" command. As in 

vars:=[a=1, b=3]:

#lots of code here that is in terms of a, b that say results in some result "r"

#show numerical value for "r" but with given values of a and b
evalf(subs(vars, r));

 

My Mathematica license is giving me problems so can't look at your attached file.  Maybe I'm still missing the big picture of what you're trying to do. 

First 12 13 14 15 16 17 18 Page 14 of 18