Message Boards Message Boards

0
|
6100 Views
|
5 Replies
|
1 Total Likes
View groups...
Share
Share this post:

How can I completely simplify the result of "PiecewiseExpand" ?

Posted 5 years ago

figure 1

Hi, guys. How can I completely simplify the result of "PiecewiseExpand" in the picture? Because the first line of the result obviously does not exist. What I want to derive is that it disappears automatically if this result does not exist. In addition, do we have any code to realize the exact conditions of "true" ? Thank you very much!

POSTED BY: Shaoyan Robert
5 Replies
Posted 5 years ago
Clear["`*"];(*G\[GreaterEqual]B*)PiecewiseExpand[
 1/(B - 1)*\[Alpha]*(B - Min[Max[((p2 - (p1 - H))/H), 1], B]) + 
  1/(B - 1)*(1 - \[Alpha])*(B - Min[Max[((p2 - (p1 - L))/L), 1], B]), 
 p1 - p2 < 0 && H > L > 0 && 0 < \[Alpha] < 1 && g >= B > 1 && 
  p1 <= L && p1 <= p2 <= g*p1]
POSTED BY: Shaoyan Robert
   PiecewiseExpand[\[Alpha]*
   Integrate[1/(
    B - 1), {x, Min[Max[(p2 - (p1 - H))/H, 1], B], 
     B}] + (1 + \[Alpha])*
   Integrate[1/(B - 1), {x, Min[Max[(p2 - (p1 - L))/L, 1], B], B}], 
 p1 - p2 < 0 && H > L > 0 && 0 < \[Alpha] < 1 && g >= B > 1, 
 Method -> {"ValueSimplifier" -> Simplify, 
   "ExpandSpecialPiecewise" -> {If, UnitStep}}]

(*  (\[Alpha] (B - Min[B, (H - p1 + p2)/H]))/(-1 + B) + ((1 + \[Alpha]) (B - Min[B, (L - p1 + p2)/L]))/(-1 + B)*)

$$\frac{\alpha \left(B-\min \left(B,\frac{H-\text{p1}+\text{p2}}{H}\right)\right)}{B-1}+\frac{(\alpha +1) \left(B-\min \left(B,\frac{L-\text{p1}+\text{p2}}{L}\right)\right)}{B-1}$$

POSTED BY: Mariusz Iwaniuk
Posted 5 years ago

Thank you for your help, but this is not what I want. I want the similar result (piecewise function) as that of my picture, but it does not include the first line, because the first line is wrong or it should not exist considering the conditions, i.e., p1 - p2 < 0 && H > L > 0 && 0 < \[Alpha] < 1 && g >= B > 1 && p1 <= L && p1 <= p2 <= g*p1.

POSTED BY: Shaoyan Robert

A correction. See my last answer.

POSTED BY: Mariusz Iwaniuk
Posted 5 years ago

Thank you, but I want to derive the result of a piecewise function, instead of Max or Min, just like the function in the picture. I just want to simplify the result, the first line of the result should not exist.

POSTED BY: Shaoyan Robert
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract