MaPal93

175 Reputation

6 Badges

2 years, 330 days

MaplePrimes Activity


These are questions asked by MaPal93

In relation to my comment below:
https://www.mapleprimes.com/questions/238277-Robustness-Of-Plotevalsomething#comment301920 (whose my worksheet rho-analysis_mmcdara_Gammapositive_MaPal.mw builds on the Sturm's analysis of @mmcdara)

I would like to better understand how to isolate/pin down the 4 real roots whose existence was confirmed by Sturm's analysis. To do so, @acer suggested to look into RootFinding:-Parametric: rho-analysis_acc(1).mw
Questions:

  1. Why the plot doesn't change if I also include -1<rho and rho<1 among the equations to solve? I understood that regions 1, 4 and 5 have 0 solutions anyway but if I add the constraints on rho I should expect 2 regions instead of 5, right?

  2. I don't understand SampleSolutions(m,2)=0.56 and SampleSolutions(m,3)=0.51 (even after reading help page). How are these numeric values found?

  3. Looking at the big picture, how to reconcile this CellPlot with A) my plot3d of Eq in https://www.mapleprimes.com/questions/238277-Robustness-Of-Plotevalsomething#comment301920 and B) @mmcdara Sturm's analysis. I am having a hard time putting all together.

    Thank you. 

    EDIT: I formulated this question by branching out from my comment 
    https://www.mapleprimes.com/questions/238277-Robustness-Of-Plotevalsomething#comment301920 in the corresponding thread. If inappropriate, please help me migrate this question as appropriate. 

I noticed that in a legend with:

  1. Three elements
  2. linestyle = [solid, longdash, dash]
  3. thickness = [4, 4, 4]

The three different linestyles are distinguishable in the plots (of course, since the curves span the whole plot area) but indistinguishable in the legend box. Since the legend box is too narrow, the symbols for a solid line, a longdash line, and a dash line are equivalent, resulting in confusion regarding which element is associated to each linestyle. Note that I don't want to use three different colors to achieve that or change my font sizes

  1. How can I "show more" of the linestyle in the legend box? "Longer" line symbols in the legend box would allow to dinstinguish a solid from a longdash from a dash even when all three are quite thick.
  2. Alternatively, can I reduce the thickness of the line symbols in the legend box (leaving unaltered the thickness of the lines in the actual plot)? "Slimmer" line symbols in the legend box would allow to dinstinguish a solid from a longdash from a dash even when all three are quite short.

I am using fsolve() to solve a highly nonlinear system of 6 equations in 6 variables: lambda_d1, lambda_i1, lambda_d2, lambda_i2, lambda_d3, lambda_i3.

fsolve() doesn't "solve"! I usually help fsolve() with some initial conditions and with the expected signs of the solution but in this case it's not enough. I noticed that if I comment out the expected signs line (that is, if I don't impose my 6 lambdas to be strictly positive), the fsolve() works.
How do I help fsolve() to pin down only positive solutions at each iteration? I have no reasons to believe that there aren't any positive solutions for all 6 lambdas...

Worksheet: fsolve_help.mw

thank you.

I want to define an alias L_2 in terms of another alias L_1, the latter being a RootOf(). I noticed that doing the following does not work: alias_in_alias.mw. How to fix it? Should I define the two alias sequantially? That is, L_1 first and then (in a follow up alias()) L_2?

Sorry for the super complicated expressions. You could perhaps show me with a simpler example. Thanks!

I am trying to verify a solution by checking whether eval() returns 0 but it's taking me forever. If I recall correctly it once returned [0,0] so I am quite confident that the first and only positive root of that polynomial solves my system. I am now running again the same calculation but somehow eval() is stuck in "Evaluating...". I am not sure if it matters here, but parameters gamma, sigma_v, and sigma_d are strictly positive while -1<rho<+1 (rho is a correlation coefficient). 

How else can I verify such solution?

EDIT: THIS IS NOT A DUPLICATE QUESTION AND SHOULDN'T BE TAGGED AS SUCH

restart;

local gamma:

Equations:

eq1 := (gamma*sigma__v^2*(-1 + rho__v) - 2*lambda__2)*(rho__v*sigma__v^2 + sigma__v^2)/((2*gamma*(lambda__1 + lambda__2)*(-1 + rho__v)*sigma__v^2 - 8*lambda__1*lambda__2)*((gamma*sigma__v^2*(-1 + rho__v) - 2*lambda__2)^2*(2*rho__v*sigma__v^2 + 2*sigma__v^2)/(2*gamma*(lambda__1 + lambda__2)*(-1 + rho__v)*sigma__v^2 - 8*lambda__1*lambda__2)^2 + (-lambda__1*(gamma*sigma__v^2*(-1 + rho__v) - 4*lambda__2)/(2*gamma*(lambda__1 + lambda__2)*(-1 + rho__v)*sigma__v^2 - 8*lambda__1*lambda__2) + 1)^2*sigma__d^2 + gamma^2*lambda__2^2*sigma__v^4*(-1 + rho__v)^2*sigma__d^2/(2*gamma*(lambda__1 + lambda__2)*(-1 + rho__v)*sigma__v^2 - 8*lambda__1*lambda__2)^2)):

eq2 := (gamma*sigma__v^2*(-1 + rho__v) - 2*lambda__1)*(rho__v*sigma__v^2 + sigma__v^2)/((2*gamma*(lambda__1 + lambda__2)*(-1 + rho__v)*sigma__v^2 - 8*lambda__1*lambda__2)*((gamma*sigma__v^2*(-1 + rho__v) - 2*lambda__1)^2*(2*rho__v*sigma__v^2 + 2*sigma__v^2)/(2*gamma*(lambda__1 + lambda__2)*(-1 + rho__v)*sigma__v^2 - 8*lambda__1*lambda__2)^2 + (-(gamma*sigma__v^2*(-1 + rho__v) - 4*lambda__1)*lambda__2/(2*gamma*(lambda__1 + lambda__2)*(-1 + rho__v)*sigma__v^2 - 8*lambda__1*lambda__2) + 1)^2*sigma__d^2 + gamma^2*lambda__1^2*sigma__v^4*(-1 + rho__v)^2*sigma__d^2/(2*gamma*(lambda__1 + lambda__2)*(-1 + rho__v)*sigma__v^2 - 8*lambda__1*lambda__2)^2)):

Eq1, Eq2 := eq1 - lambda__1, eq2 - lambda__2:

Solution:

Gamma := gamma*sigma__v*sigma__d:
L__2 := RootOf(-8*(rho + 1)^4*_Z^4 + 12*(rho + 1)^3*Gamma*(rho - 1)*_Z^3 - 5*(rho + 1)^2*(-4/5 + Gamma^2*rho^2 + 2*(-2/5 - Gamma^2)*rho + Gamma^2)*_Z^2 - 4*(rho + 1)*Gamma*(rho^2 - 1)*_Z + Gamma^2*(rho + 1)*(rho - 1)^2);
l__2 := L__2*sigma__v*(rho__v + 1)/sigma__d:
quartic_solution := lambda__2 = simplify(allvalues~([l__2]))[1]:

RootOf((8*rho^3+24*rho^2+24*rho+8)*_Z^4+(-12*gamma*rho^3*sigma__d*sigma__v-12*gamma*rho^2*sigma__d*sigma__v+12*gamma*rho*sigma__d*sigma__v+12*gamma*sigma__d*sigma__v)*_Z^3+(5*gamma^2*rho^3*sigma__d^2*sigma__v^2-5*gamma^2*rho^2*sigma__d^2*sigma__v^2-5*gamma^2*rho*sigma__d^2*sigma__v^2+5*gamma^2*sigma__d^2*sigma__v^2-4*rho^2-8*rho-4)*_Z^2+(4*gamma*rho^2*sigma__d*sigma__v-4*gamma*sigma__d*sigma__v)*_Z-gamma^2*sigma__v^2*sigma__d^2*rho^2+2*rho*gamma^2*sigma__v^2*sigma__d^2-gamma^2*sigma__v^2*sigma__d^2)

(1)

Check: TOO SLOW

simplify(eval([eval(Eq1, lambda__1 = lambda__2), eval(Eq2, lambda__1 = lambda__2)], quartic_solution));


 

Download solution_check.mw

1 2 3 4 5 6 7 Page 3 of 9