MichaelChen

28 Reputation

2 Badges

17 years, 364 days

MaplePrimes Activity


These are replies submitted by MichaelChen

Thanks, acer, it works. I changed all expressions to functions, i.e., B11:=(x1,x2)->x1<=B1 and x2<=B2; E11:=(x1,x2)->... ... And it works perfectly. Appreciate yours, Robert's and Doug's warmhearted helps! Michael Chen
Dear Robert and Acer, Thanks so much for your response. And sorry for the mangled code, I attached my Worksheet, this time it shall be easier for us. Download 5059_temp.mws
View file details If you don't mind, my questions are: (1) Why evaluation of both Eobj and Eobj2 failed? Robert explained why evaluation of Eobj2 failed, but it doesn't seem to apply to Eobj. (2) Why the plot of Eobj succeed, while the plot of Eobj2 failed (wrong)? Especially under the situation that both Eobj and Eobj2 can not be evaluated. (3) Immediately after definition of Eobj2, I can see that B11 and other boolean variables are expanded, while E11 and other didn't? Is there any way to get all those intermediate variables expanded? I hope the questions are interesting to you too. Looking forward to your response. Michael Chen
Dear Robert, You are right, `if` can not be evaluated because B11 is unzipped later and its expression contains x1 and x2, which can not be replaced. So I manually replaced `if`(B11, E11,0) to `if`(x1>0, x1 * x2, 0), where the definition of B11 was x1>0. Now it can be evaluated. The problem is there are too many B11 or E11 to be replaced to their original definitions. And it seems going backward! Can't Maple do these simple substitutions? Michael Chen
Thanks Robert, your answer is quite helpful. I thought x1 and x2 will be replace recursively in the Eobj. In my code, B1 or B2 stands for boolean 1 or boolean 2. For the problem at my hand, I'd better to build up boolean expressions one on top of another, i.e., B11 = B1 and another boolean expression, B111 = B11 and some exp., B112 = B11 and another exp. Using procedure to define Eobj is not a bad idea. However, it doesn't seems convenient for my case, because I also need to define Eobj2, Eobj3, and they all need the boolean expressions B1, B2, B11, B112... Thanks for your help again. Michael Chen
Page 1 of 1