MapleEnthusiast

60 Reputation

2 Badges

4 years, 344 days

MaplePrimes Activity


These are replies submitted by MapleEnthusiast

Dear @acer, sorry for the follow-up (I'm new to this forum and am still learning how things work here): I did post my update to this thread but did not get any response for a while. Is it possible that my update got simply overlooked? And, under what conditions am I allowed to repost my update as a separate thread? Thank you very much in advance.

Dear Maple community,

I would really appreciate it if you could help me with the following (somehwhat) revised Problem.mw (sorry for the lengthy description -- unfortunately, I'm not a mathematician and didn't know how to state the problem more consisely):

 @acer and @vv have kindly provided the following Problem_Solution.mw

Thank you very much in advance!

 

Dear @acer,

Thank you very much for the explanation -- that helps a lot to understand the procedure. In the meantime, I have somewhat rethought my problem and (since I wasn't sure whether you're checking this old thread) have posted a more concise version of my problem in a new thread (I hope it's ok). I really appreciate your amazing help.

Dear @acer and @vv,

Thank you very much for your great help! Just for clarification: In both of your solutions, Maple seems to choose by default the last unknown (in our example, dlog R[3,1]) as the scaling factor. Is there a way to "manually" designate an alternative scaling factor (say, dlog R[1,1] or dlog R[2,1])?

Perhaps more broadly, do you happen to have a reference for me how exactly (using which "algorithm") Maple solves linear equations under a constraint up to scale (just so that I better understand what's happening "behind the scenes"). Thank you very much in advance. 

Dear @Carl Love,

Thank you so much for your great help -- using your code I was able to simplify the expression significantly.

May I briefly follow up to ask whether your code can be generalized to allow for double sums in the side relations. More specifically, the symbolic expressions for pi's in that case would read:

and

 

where, as before, {i,j}∈J, {r,u}∈S, and F is a fixed constant symbol.

Thank you very much in advance -- I truly appreciate your help.

@sand15 

Thanks for your response. Your code is helpful for me to better understand how the algsubs command works, however, I couldn't figure out how to combine it with the simplify command to simplify more complex expressions, like the one provided in my original question (sorry, I'm still a Maple newbie...). I'd appreciate any advice in this regard. Thank you.

Thanks @Carl Love. The pattern in terms of symbols is as follows:

@acer 

I was hoping I could apply myself the answers from a simplest possible case withouth confusing everyone with the lengthy formulas. Unfortunately, I wasn't able to do so -- sorry about that...

Dear @Kitonum @acer @Joe Riel,

Thank you so much for your quick responses. May I somewhat expand on my original question? Consider please the attached Example.mw (which stems from some previous derivations). I would like to simplify this (lengthy) function to find a "pattern", which I would like to ultimately summarize using the sigma-notation. Note that, whenever gamma appears with an exponent, the simplify(.) command seems to treat this expression differently and does not "factor it in" into the other expressions (brackets). Is there a way to make simplify(.) treat gamma^2 as gamma*gamma and, in so doing, simplify the terms more compactly? Thank you.  

@Carl Love That worked, thanks! 

Sorry for the stupid question, but how do I further process your (abstractly defined) "MyA" if I want to, say, expand it for given parameter values (e.g., {S=2, J=2, i=1, r=1}) and then differentiate with respect to, say, pi[1,2,1,2]. 

Thank you.

  

Thank you so much @Carl Love 

When I copy-paste your formula (in Maple 2020), I get the following error message: "Error, invalid arrow procedure". Do you happen to know what's causing it?

@Carl Love 

 Thank you very much for your, as always, extremeley helpful answers! May I follow-up on one of your comments regarding (Physics:-Library:-Add) from Aug. 22? (or should I start a separate thread for that?)

Please consider the expression ("A") attached below. I would like to do the following 2 things with this expression:

1. Evaluate it numerically for various combinations of parameter values, and

2. Differentiate it with respect to selected variable using the diff( ) command.

You mentioned that you might be able to help me with the computation (step 1 above) -- may I take you up on your offer? (Needless to say, you don't have to code the entire equation yourself -- I would just highly appreciate it if you could tell me how to code those sums that where z≠j, as well as the indicator functions.) Also, do you happen to know whether the Physics package can be used to condut step 2?

Thank you very much in advance!

Dear @Carl Love, thanks for your response. Absolutely, I'd be happy to practice with a smaller (8x8 system) and learn from you the relevant commands! The code for that system would be as provided for you on Aug 18, but with J=2 (instead of J=3), and j=2 (instead of j=3):

restart:
local gamma: #Overrides Maple's predefined gamma constant.
EQ:= P[j,r,u] = Sum(
    pi[i,j,r,u]*(gamma[i,r]*rho[i,r] + Sum(gamma[i,s,r]*P[i,s,r], s= 1..S)),
    i= 1..J
);
eq:= value(eval(EQ, [J= 2, S= 2])):
sys:= [seq](seq(seq(eq, j= 1..2), r= 1..2), u= 1..2);
Ps:= indets(sys, specindex(P));

As to your questions from the last response:

1. No, each of the expanded numerators will contain all possible rho-permutations (which will be 4 in the 8x8 system: rho[1,1], rho[1,2], rho[2,1], and rho[2,2]), and each of those rho's will be multiplied with a different polinomial (hence, the numer function by itself would not do the job of extracting each individual rho from the numerator; as previously mentioned, I was applying so far collect(..., rho[1,1]), ...,collect(, rho[2,2]) to collect all terms multiplying each of the rho's, but it would be great if you could tell me a more efficient way to do so, which wouldn't involve mouse-selection+copy-pasting). 

2. Your guess on what I'm trying to achieve with this exercise is pretty accurate. I have a quick related question: In my experience with this type of models, it offen involves terms like , where the last summation mark runs for all z≠j. How do I typeset this term in Maple? (I've been trying to do so using the assume(.) function, however, whenever I "expand" the sum using numerical values for j, it's not working). 

3. Lastly, and most importantly, having the terms sorted would be of great help to detect the pattern. More specifically, so far, I've been using the sort() command to simply sort the expressions by their length (i.e., the terms containing 2 pi's, 3 pi's, 4 pi's etc.) However, sorting by the indices (of either pi's or gamma's or both?) would certainly help a lot to detect the underlying pattern. 

Please let me know if I can provide you with any further information and I'm looking forward to learning more from you! 

Thank you so much, @Carl Love and @acer, for your very helpful responses! I have a couple of clarifying questions:

@Carl Love (your recoding of the system is correct and the hints on dealing with Maple's GUI extremely helpful): Once I solved for the Ps (i.e, {P[1,1,1], ..., P[3,2,2]}), I would like to analyze and simplify one-by-one the terms multiplying the rho's (i.e., {rho[1,1], ..., rho[3,2]}). So far, I've been applying the collect() command (say, collect(P[1,1,1], rho[2,2])) to collect all terms multiplying the rho[2,2] and then select the relevant part with the mouse (which goes against your point 4) and copy-paste it below (which violates your point 1), see attached Problem_3.mw. Is there a smart(er) way to separately store and display all terms multiplying the set of {rho[1,1], ..., rho[3,2]}?

@acer As to your question on what I intend to do with those lengthy results: I would like to simplify them in the summation (sigma) and/or product (pi) notation. In my previous experience dealing with (a much simpler version of) this model, the underlying model mechanisms make sure that, once the relevant pattern is detected, the huge terms can be expressed in a very compact way using the sigma/pi-notation. Unfortunately, simplify(..., size) is of little help to detect this pattern (see last expression in the attached Problem_3.mw) and, so far, I've been trying to detect this pattern with a "naked eye". I was wondering whether Maple can be of any use to assist me with this (very tedious) task (I'm aware of the conver(..., sum) command, but am not sure how to apply it in this particular case). Please let me know if I should provide you with some examples of how I converted the very lengthy and complicated terms into the sigma notation so far. 

Thanks again for your amazing help! I really appreciate it.  

 

Thank you so much, @Carl Love 

Yes, the difference in gamma's indices is intentional (and correct). 

I have now run the above-mentioned code using solve({},{}) (on a 64GB RAM machine) within 20 min. However, the output is so extensive that my desktop is having hard time further processing it (e.g., simplify). I was wondering whether solving the Moore-Penrose inverse would allow to store the output more efficiently? 

Thanks again for your patience and not giving up on this problem (or me)...

1 2 3 4 Page 3 of 4