Andiguys

65 Reputation

5 Badges

1 years, 74 days

MaplePrimes Activity


These are replies submitted by Andiguys

@acer
I had shared the complete details of the substitutions and their explanations in my message last week. Could you please confirm if you were able to review that? I can resend the details if needed. Thankyou. 

@sand15 Thankyou so much.

@sand15 The z-axis values are still shown only up to zero—how can I extend it to display positive values? Also, how can I display the z-value at point P?

@sand15 @acer Thankyou 

@Carl Love Correction: only s1, s2​, and d are greater than or equal to zero. All other parameters can take positive or negative values

restart

kernelopts(version)

`Maple 2019.1, X86 64 WINDOWS, May 21 2019, Build ID 1399874`

(1)

X3 := 0 >= A*s1^2+B*s1+C

A*s1^2+B*s1+C <= 0

(2)

X4 := s1 <= (-4*A*d*s2-F)/(4*d*A)

s1 <= (1/4)*(-4*A*d*s2-F)/(d*A)

(3)
 

`assuming`([solve({X3, X4}, {s1})], [s1 > 0, s2 > 0, d > 0])

Download Q_s.mw

@acer 
 

Substitution
In the sheet attached below, I’ve substituted Cmin⁡=β1and Cmax⁡=β2​.
Is this substitution correct, or should it instead be Cmin⁡=−β1 and Cmax⁡=−β2​ (or the other way around)?
This is my first point of confusion.


Regarding the table
From the solution set named SC_CS_sols, I have values for:

  • Pc∗​ (optimal Pc​)

  • μ1​

  • μ2​

I want these results presented in a table where:

  • Column 1 → optimal Pc value

  • Cloumn 2 → μ1​ value

  • Column 3 → μ2​ value

As you know, in the KKT conditions there are three cases, which the above table signifies:

  1. μ1=0, μ2>0

  2. μ2=0, μ1>0

  3. μ1=μ2=0

The table should show the optimal Pc​ value for each of these cases.I just want to tabulate it and export as doc or pdf format.

Questions are highlighted in yellow in sheet.

KKT_Table_Q-22.mw

can you help me in  solving the values of s1 that satisfy both inequality constraints simultaneously — in other words, find a condition or range for s1​, such as s1=… , given ...... > …, under which both inequalities are true.

restart

kernelopts(version)

`Maple 2019.1, X86 64 WINDOWS, May 21 2019, Build ID 1399874`

(1)

X3 := 0 >= A*s1^2+B*s1+C

A*s1^2+B*s1+C <= 0

(2)

X4 := s1 <= (-4*A*d*s2-F)/(4*d*A)

s1 <= (1/4)*(-4*A*d*s2-F)/(d*A)

(3)

``

extra1 := `~`[`>`](indets(X3, And(name, Not(constant))), 0)

{0 < A, 0 < B, 0 < C, 0 < s1}

(4)

extra2 := `~`[`>`](indets(X4, And(name, Not(constant))), 0)

{0 < A, 0 < F, 0 < d, 0 < s1, 0 < s2}

(5)

`assuming`([solve({X3, X4}, {s1})], [extra1[], extra2[]])

Download Q_s.mw

@acer Hi can you help me to tabulate the result? and verify whether the substititution i made are right. Thankyou

@sand15 Thankyou.

Can in anyway possible to take out  delta3  from the equaltion so that i get condition like delta > or < (delta3) * L expression.

Basically to show relationship between delta and delta3.

@sand15 Thankyou

@sand15 The delta values range from 0 to 0.5, and the w values range from 10,000 to 90,000. I’ve already updated the ranges accordingly, but the hatch pattern syntax is throwing an error.

I want hatch portion, also to be shown in legend? how to do that? hatch represent - piD>piR:

restart

with(Optimization); with(plots); with(Student[VectorCalculus]); with(LinearAlgebra)

NULL

`&pi;R` := 1.384512885*10^7+20930000*delta-230*w*delta-79350000*delta^2

13845128.85+20930000*delta-230*w*delta-79350000*delta^2

(1)

`&pi;D` := 1.615473870*10^7-6325000*delta*(1/177)-32269*w*(1/1062)-230*w*delta-529*(690000*delta+w-91500)^2*(1/845883000)-79350000*(2*delta*(1/531)-23*w*(1/15930000)+1403/10620)^2

16154738.70-(6325000/177)*delta-(32269/1062)*w-230*w*delta-(529/845883000)*(690000*delta+w-91500)^2-79350000*((2/531)*delta-(23/15930000)*w+1403/10620)^2

(2)

Di := `&pi;R`-`&pi;D`

-2309609.85+(3710935000/177)*delta-79350000*delta^2+(32269/1062)*w+(529/845883000)*(690000*delta+w-91500)^2+79350000*((2/531)*delta-(23/15930000)*w+1403/10620)^2

(3)

# Step 1: try to figure out the scales of the domain where to use plots:-inequal

simplify(`&pi;R`-`&pi;D`);
S := solve(%=0, w):

eval([S], delta=0.2);
eval(`&pi;R`-`&pi;D`, {delta=0.2, w=8*10^4});
eval(`&pi;R`-`&pi;D`, {delta=0.2, w=3*10^4});

eval([S], delta=0.4);
eval(`&pi;R`-`&pi;D`, {delta=0.4, w=8*10^4});
eval(`&pi;R`-`&pi;D`, {delta=0.4, w=3*10^4});

-919490.4996+20965734.46*delta-79051129.94*delta^2+0.1660389203e-3*w^2

 

[25926.80090*I, -25926.80090*I]

 

1174260.286

 

261046.2242

 

[176651.6374, -176651.6374]

 

-4118728.416

 

-5031942.477

(4)

# As a rule (IMO) the function to use to compare, let's say a(u, v) and b(u, v) is plots/inequal
# (read the corresponding help page)
# When it appears that a(u, v) - b(u, v) = c(u) using plots:inequal is kind of a hammer to kill a fly,
# nevertheless here is an example:

LX := 0.4:
LY := 80000:

# Plot region where πR > πD
p := plots:-display(
  plots:-inequal(
    `&pi;R` > `&pi;D`,
    delta = 0 .. LX,
    w = 20000 .. LY,
    color = "Chartreuse"
  ), axes=boxed
  
);

display(
p,plot(x, x=0..0.1, color="Chartreuse", thickness=10, legend=typeset('`&pi;R`' > '`&pi;D`')),
  view = [0 .. LX, 20000 .. LY],labels = ['w', 'delta']);
 

 

 

eps  := 0.001:

OneHatch := display(
              plottools:-polygon(
                [[-2*LX, -2*LX-eps], [2*LX, 2*LX-eps], [2*LX, 2*LX+eps], [-2*LX, -2*LX-eps], [-2*LX, -2*LX-eps]]
                , color=gray
                , style=line
              )
            ):

Tr := plottools:-transform((x, y) -> [x, y*LY/LX]):

back := display(
          seq(
            plottools:-translate(Tr(OneHatch), 0, h)
            , h=-2*LY..2*LY, LY/10
          )
          , view=[-LX..LX, -LY..LY]
          , axes=framed
        );

 

display(p, back, plot(x, x = -LX .. -(1/2)*LX, color = "Chartreuse", thickness = 10, legend = typeset('`&pi;R`' > '`&pi;D`')), view = [0 .. LX, 20000 .. LY])

 

"legend for hatch"?""


Download Q1_regional_plot.mw

@sand15 I'm using two different variables—one ranging from 20,000 to 60,000 and the other from 0 to 0.4—but the current syntax doesn't work. Could you help me identify what's going wrong?

restart

with(Optimization); with(plots); with(Student[VectorCalculus]); with(LinearAlgebra)

NULL

`&pi;R` := 1.384512885*10^7+20930000*delta-230*w*delta-79350000*delta^2

13845128.85+20930000*delta-230*w*delta-79350000*delta^2

(1)

`&pi;D` := 1.615473870*10^7-6325000*delta*(1/177)-32269*w*(1/1062)-230*w*delta-529*(690000*delta+w-91500)^2*(1/845883000)-79350000*(2*delta*(1/531)-23*w*(1/15930000)+1403/10620)^2

16154738.70-(6325000/177)*delta-(32269/1062)*w-230*w*delta-(529/845883000)*(690000*delta+w-91500)^2-79350000*((2/531)*delta-(23/15930000)*w+1403/10620)^2

(2)

Di := `&pi;R`-`&pi;D`

-2309609.85+(3710935000/177)*delta-79350000*delta^2+(32269/1062)*w+(529/845883000)*(690000*delta+w-91500)^2+79350000*((2/531)*delta-(23/15930000)*w+1403/10620)^2

(3)

simplify(`&pi;R`-`&pi;D`);  # Note that the diffference does not depend upon g2

solve(%=0)

-919490.4996+20965734.46*delta-79051129.94*delta^2+0.1660389203e-3*w^2

 

{delta = delta, w = 0.1204536862e-4*(0.3281391066e22*delta^2-0.8702819783e21*delta+0.3816780244e20)^(1/2)}, {delta = delta, w = -0.1204536862e-4*(0.3281391066e22*delta^2-0.8702819783e21*delta+0.3816780244e20)^(1/2)}

(4)

# As a rule (IMO) the function to use to compare, let's say a(u, v) and b(u, v) is plots/inequal
# (read the corresponding help page)
# When it appears that a(u, v) - b(u, v) = c(u) using plots:inequal is kind of a hammer to kill a fly,
# nevertheless here is an example:

plots:-display(
  plots:-inequal(
    `&pi;R` > `&pi;D`
    , w=20000..80000
    , delta=0.1..0.4
    , color="Chartreuse"
    , optionsexcluded=[color="Lavender"]
  )
  , plot([[20000, 60000], [0.1, 0.3]], color="Chartreuse", thickness=10, legend=typeset('`&pi;R`' > '`&pi;D`'))
  , plot([[20000, 60000], [0.1, 0.3]], color="Lavender"  , thickness=10, legend=typeset('`&pi;R`' < '`&pi;D`'))
  , axes=boxed
)

 

y := -919490.4996+2.096573446*10^7*delta-7.905112994*10^7*delta^2+0.1660389203e-3*w^2

-919490.4996+20965734.46*delta-79051129.94*delta^2+0.1660389203e-3*w^2

(5)

plot3d(y, w = 20000 .. 80000, delta = .1 .. .4)

 
 

``

Download Regional_plot_sand15_(1).mw

@sand15 Thankyou so much.

Just one more question.

How can I modify the syntax to display crosshatched or shaded grid lines in the plot regions instead of using solid fill colors? For example, similar to the figure below where regions are distinguished by patterned lines—how can I achieve that effect?

@sand15 In the current figure, the y-axis range is too limited, making the ZR line invisible. Is there a way to extend the y-axis range while still keeping the plot within a box?
Also, is it possible to add a horizontal dotted line at y = 0? How can I include that in the plot?
 

restart

with(plots)

``

``

KM1w := 1.773782789*10^7-94*w*(1/3)-(1/3000)*w*(94000-w)-(1/6000)*(94000-w)^2

17737827.89-(94/3)*w-(1/3000)*w*(94000-w)-(1/6000)*(94000-w)^2

(1)

KM2w := 1.705786795*10^7-94*w*(1/3)-(1/3000)*w*(814000-w)-86400000*(47/360-(1/720000)*w)^2

17057867.95-(94/3)*w-(1/3000)*w*(814000-w)-86400000*(47/360-(1/720000)*w)^2

(2)

P4 := plot([KM1w, KM2w], w = 20000 .. 80000, legend = ["ZR", "ZD"], titlefont = ["ARIAL", 15], labels = ["w", "Manufacturer Profit"], labeldirections = ["horizontal", "vertical"], labelfont = ["HELVETICA", 10], color = ["Blue", "Yellow"], linestyle = [solid, longdash], axes = boxed, axesfont = ["HELVETICA", "ROMAN", 9], legendstyle = [font = ["HELVETICA", 9], location = right])

 

``


 

Download QQQQ.mw

@sand15 Thankyou

1 2 3 4 5 6 7 Last Page 1 of 9