Solve struggles to solve equation with variable constraint
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I am trying to find x,y set satisfying FOC with the constraint:
0<x<=y<1
Here is my code, which does not give anything.
Dbuy = 1 - (x/y) - x*Log[y/x];
Dwait = (x/y) - x;
revx = D[(Dbuy*x + Dwait*CCC*y), x]
revy = D[(Dbuy*x + Dwait*CCC*y), y]
revsln=Solve[revx==0, revy==0,x,y]
When I use FindRoot function instead of Solve for a fixed value of CCC (between 0 and 1, for example 0.4), it gives me numerical values (0.322, 0.581) if I add
x,0.01, y,0.01
But I want some form of closed-form solution for
0<=C<=1
What do you guys think?
equation-solving mathematical-optimization
New contributor
add a comment |Â
up vote
3
down vote
favorite
I am trying to find x,y set satisfying FOC with the constraint:
0<x<=y<1
Here is my code, which does not give anything.
Dbuy = 1 - (x/y) - x*Log[y/x];
Dwait = (x/y) - x;
revx = D[(Dbuy*x + Dwait*CCC*y), x]
revy = D[(Dbuy*x + Dwait*CCC*y), y]
revsln=Solve[revx==0, revy==0,x,y]
When I use FindRoot function instead of Solve for a fixed value of CCC (between 0 and 1, for example 0.4), it gives me numerical values (0.322, 0.581) if I add
x,0.01, y,0.01
But I want some form of closed-form solution for
0<=C<=1
What do you guys think?
equation-solving mathematical-optimization
New contributor
1
Well, do you have any reason to expect a closed-form solution exists at all?
â AccidentalFourierTransform
2 hours ago
I feel that the root for the constraint 0<=x<=y<=1 has a closed-form. Is there a way to check it? Or is there a way to add a constraint to "Solve" function? Or is there a way to find a closed-form approximation?
â Ovunc
2 hours ago
1
In 11.3 I get a "This system cannot be solved with the methods available to Solve." message. Probably means the system cannot be solved with the methods available to Solve, no? Even if I drop the floatingCCC
I getRoot
objects parametrized near to a value.
â b3m2a1
2 hours ago
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I am trying to find x,y set satisfying FOC with the constraint:
0<x<=y<1
Here is my code, which does not give anything.
Dbuy = 1 - (x/y) - x*Log[y/x];
Dwait = (x/y) - x;
revx = D[(Dbuy*x + Dwait*CCC*y), x]
revy = D[(Dbuy*x + Dwait*CCC*y), y]
revsln=Solve[revx==0, revy==0,x,y]
When I use FindRoot function instead of Solve for a fixed value of CCC (between 0 and 1, for example 0.4), it gives me numerical values (0.322, 0.581) if I add
x,0.01, y,0.01
But I want some form of closed-form solution for
0<=C<=1
What do you guys think?
equation-solving mathematical-optimization
New contributor
I am trying to find x,y set satisfying FOC with the constraint:
0<x<=y<1
Here is my code, which does not give anything.
Dbuy = 1 - (x/y) - x*Log[y/x];
Dwait = (x/y) - x;
revx = D[(Dbuy*x + Dwait*CCC*y), x]
revy = D[(Dbuy*x + Dwait*CCC*y), y]
revsln=Solve[revx==0, revy==0,x,y]
When I use FindRoot function instead of Solve for a fixed value of CCC (between 0 and 1, for example 0.4), it gives me numerical values (0.322, 0.581) if I add
x,0.01, y,0.01
But I want some form of closed-form solution for
0<=C<=1
What do you guys think?
equation-solving mathematical-optimization
equation-solving mathematical-optimization
New contributor
New contributor
edited 2 hours ago
b3m2a1
25k254147
25k254147
New contributor
asked 2 hours ago
Ovunc
234
234
New contributor
New contributor
1
Well, do you have any reason to expect a closed-form solution exists at all?
â AccidentalFourierTransform
2 hours ago
I feel that the root for the constraint 0<=x<=y<=1 has a closed-form. Is there a way to check it? Or is there a way to add a constraint to "Solve" function? Or is there a way to find a closed-form approximation?
â Ovunc
2 hours ago
1
In 11.3 I get a "This system cannot be solved with the methods available to Solve." message. Probably means the system cannot be solved with the methods available to Solve, no? Even if I drop the floatingCCC
I getRoot
objects parametrized near to a value.
â b3m2a1
2 hours ago
add a comment |Â
1
Well, do you have any reason to expect a closed-form solution exists at all?
â AccidentalFourierTransform
2 hours ago
I feel that the root for the constraint 0<=x<=y<=1 has a closed-form. Is there a way to check it? Or is there a way to add a constraint to "Solve" function? Or is there a way to find a closed-form approximation?
â Ovunc
2 hours ago
1
In 11.3 I get a "This system cannot be solved with the methods available to Solve." message. Probably means the system cannot be solved with the methods available to Solve, no? Even if I drop the floatingCCC
I getRoot
objects parametrized near to a value.
â b3m2a1
2 hours ago
1
1
Well, do you have any reason to expect a closed-form solution exists at all?
â AccidentalFourierTransform
2 hours ago
Well, do you have any reason to expect a closed-form solution exists at all?
â AccidentalFourierTransform
2 hours ago
I feel that the root for the constraint 0<=x<=y<=1 has a closed-form. Is there a way to check it? Or is there a way to add a constraint to "Solve" function? Or is there a way to find a closed-form approximation?
â Ovunc
2 hours ago
I feel that the root for the constraint 0<=x<=y<=1 has a closed-form. Is there a way to check it? Or is there a way to add a constraint to "Solve" function? Or is there a way to find a closed-form approximation?
â Ovunc
2 hours ago
1
1
In 11.3 I get a "This system cannot be solved with the methods available to Solve." message. Probably means the system cannot be solved with the methods available to Solve, no? Even if I drop the floating
CCC
I get Root
objects parametrized near to a value.â b3m2a1
2 hours ago
In 11.3 I get a "This system cannot be solved with the methods available to Solve." message. Probably means the system cannot be solved with the methods available to Solve, no? Even if I drop the floating
CCC
I get Root
objects parametrized near to a value.â b3m2a1
2 hours ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
Until someone comes up with a method that yields an analytical solution, you can use NArgMax
:
argmax[c_?NumericQ] := NArgMax[Dbuy*x + Dwait*c*y,
0 <= c <= 1, 0 <= x <=1, 0<= y < 1, x <= y, x, y]
ParametricPlot[Evaluate@t, t, argmax[t], t, 0, 1,
PlotRange -> 0, 1, 0, 1, Frame -> True]
are these the optimal (x,y) combinations for 0<=c<=1?
â Ovunc
5 secs ago
add a comment |Â
up vote
2
down vote
Here's a way to get a sense for the kinds of things for want. We'll solve this (exactly!) for a large number of values for CCC
, plot them, and extract meaning out of that.
Here's the basic code I'll fux with:
blurg[CCC_] :=
Block[
ccc = Rationalize[CCC],
Dbuy,
Dwait,
revx,
revy,
x, y
,
Dbuy = 1 - (x/y) - x*Log[y/x];
Dwait = (x/y) - x;
revx = D[(Dbuy*x + Dwait*ccc*y), x];
revy = D[(Dbuy*x + Dwait*ccc*y), y];
Solve[revx == 0, revy == 0, x, y, Reals]
]
solns =
blurg /@ Rest@Subdivide[0, 1, 100];
N[x, y /. #, 50] & /@ solns //
ListPlot[#, PlotStyle -> Map[Hue, Range[0, 1, 1/Length@solns]]] &
You can see you always have two solutions and they converge down to those end-points at CCC=1
and apparently diverge as CCC->0
You can also look at the symbolic solutions returned but they will be nasty. Lots of complicated Root
objects
Here's another fun example:
solns =
blurg /@ Rest@Subdivide[0, .01, 25];
N[x, y /. #, 50] & /@ solns //
ListPlot[#, PlotStyle -> Map[Hue, Range[0, 1, 1/Length@solns]]] &
This shows the divergence over that side of the solutions.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
Until someone comes up with a method that yields an analytical solution, you can use NArgMax
:
argmax[c_?NumericQ] := NArgMax[Dbuy*x + Dwait*c*y,
0 <= c <= 1, 0 <= x <=1, 0<= y < 1, x <= y, x, y]
ParametricPlot[Evaluate@t, t, argmax[t], t, 0, 1,
PlotRange -> 0, 1, 0, 1, Frame -> True]
are these the optimal (x,y) combinations for 0<=c<=1?
â Ovunc
5 secs ago
add a comment |Â
up vote
3
down vote
Until someone comes up with a method that yields an analytical solution, you can use NArgMax
:
argmax[c_?NumericQ] := NArgMax[Dbuy*x + Dwait*c*y,
0 <= c <= 1, 0 <= x <=1, 0<= y < 1, x <= y, x, y]
ParametricPlot[Evaluate@t, t, argmax[t], t, 0, 1,
PlotRange -> 0, 1, 0, 1, Frame -> True]
are these the optimal (x,y) combinations for 0<=c<=1?
â Ovunc
5 secs ago
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Until someone comes up with a method that yields an analytical solution, you can use NArgMax
:
argmax[c_?NumericQ] := NArgMax[Dbuy*x + Dwait*c*y,
0 <= c <= 1, 0 <= x <=1, 0<= y < 1, x <= y, x, y]
ParametricPlot[Evaluate@t, t, argmax[t], t, 0, 1,
PlotRange -> 0, 1, 0, 1, Frame -> True]
Until someone comes up with a method that yields an analytical solution, you can use NArgMax
:
argmax[c_?NumericQ] := NArgMax[Dbuy*x + Dwait*c*y,
0 <= c <= 1, 0 <= x <=1, 0<= y < 1, x <= y, x, y]
ParametricPlot[Evaluate@t, t, argmax[t], t, 0, 1,
PlotRange -> 0, 1, 0, 1, Frame -> True]
edited 1 hour ago
answered 2 hours ago
kglr
167k8188390
167k8188390
are these the optimal (x,y) combinations for 0<=c<=1?
â Ovunc
5 secs ago
add a comment |Â
are these the optimal (x,y) combinations for 0<=c<=1?
â Ovunc
5 secs ago
are these the optimal (x,y) combinations for 0<=c<=1?
â Ovunc
5 secs ago
are these the optimal (x,y) combinations for 0<=c<=1?
â Ovunc
5 secs ago
add a comment |Â
up vote
2
down vote
Here's a way to get a sense for the kinds of things for want. We'll solve this (exactly!) for a large number of values for CCC
, plot them, and extract meaning out of that.
Here's the basic code I'll fux with:
blurg[CCC_] :=
Block[
ccc = Rationalize[CCC],
Dbuy,
Dwait,
revx,
revy,
x, y
,
Dbuy = 1 - (x/y) - x*Log[y/x];
Dwait = (x/y) - x;
revx = D[(Dbuy*x + Dwait*ccc*y), x];
revy = D[(Dbuy*x + Dwait*ccc*y), y];
Solve[revx == 0, revy == 0, x, y, Reals]
]
solns =
blurg /@ Rest@Subdivide[0, 1, 100];
N[x, y /. #, 50] & /@ solns //
ListPlot[#, PlotStyle -> Map[Hue, Range[0, 1, 1/Length@solns]]] &
You can see you always have two solutions and they converge down to those end-points at CCC=1
and apparently diverge as CCC->0
You can also look at the symbolic solutions returned but they will be nasty. Lots of complicated Root
objects
Here's another fun example:
solns =
blurg /@ Rest@Subdivide[0, .01, 25];
N[x, y /. #, 50] & /@ solns //
ListPlot[#, PlotStyle -> Map[Hue, Range[0, 1, 1/Length@solns]]] &
This shows the divergence over that side of the solutions.
add a comment |Â
up vote
2
down vote
Here's a way to get a sense for the kinds of things for want. We'll solve this (exactly!) for a large number of values for CCC
, plot them, and extract meaning out of that.
Here's the basic code I'll fux with:
blurg[CCC_] :=
Block[
ccc = Rationalize[CCC],
Dbuy,
Dwait,
revx,
revy,
x, y
,
Dbuy = 1 - (x/y) - x*Log[y/x];
Dwait = (x/y) - x;
revx = D[(Dbuy*x + Dwait*ccc*y), x];
revy = D[(Dbuy*x + Dwait*ccc*y), y];
Solve[revx == 0, revy == 0, x, y, Reals]
]
solns =
blurg /@ Rest@Subdivide[0, 1, 100];
N[x, y /. #, 50] & /@ solns //
ListPlot[#, PlotStyle -> Map[Hue, Range[0, 1, 1/Length@solns]]] &
You can see you always have two solutions and they converge down to those end-points at CCC=1
and apparently diverge as CCC->0
You can also look at the symbolic solutions returned but they will be nasty. Lots of complicated Root
objects
Here's another fun example:
solns =
blurg /@ Rest@Subdivide[0, .01, 25];
N[x, y /. #, 50] & /@ solns //
ListPlot[#, PlotStyle -> Map[Hue, Range[0, 1, 1/Length@solns]]] &
This shows the divergence over that side of the solutions.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Here's a way to get a sense for the kinds of things for want. We'll solve this (exactly!) for a large number of values for CCC
, plot them, and extract meaning out of that.
Here's the basic code I'll fux with:
blurg[CCC_] :=
Block[
ccc = Rationalize[CCC],
Dbuy,
Dwait,
revx,
revy,
x, y
,
Dbuy = 1 - (x/y) - x*Log[y/x];
Dwait = (x/y) - x;
revx = D[(Dbuy*x + Dwait*ccc*y), x];
revy = D[(Dbuy*x + Dwait*ccc*y), y];
Solve[revx == 0, revy == 0, x, y, Reals]
]
solns =
blurg /@ Rest@Subdivide[0, 1, 100];
N[x, y /. #, 50] & /@ solns //
ListPlot[#, PlotStyle -> Map[Hue, Range[0, 1, 1/Length@solns]]] &
You can see you always have two solutions and they converge down to those end-points at CCC=1
and apparently diverge as CCC->0
You can also look at the symbolic solutions returned but they will be nasty. Lots of complicated Root
objects
Here's another fun example:
solns =
blurg /@ Rest@Subdivide[0, .01, 25];
N[x, y /. #, 50] & /@ solns //
ListPlot[#, PlotStyle -> Map[Hue, Range[0, 1, 1/Length@solns]]] &
This shows the divergence over that side of the solutions.
Here's a way to get a sense for the kinds of things for want. We'll solve this (exactly!) for a large number of values for CCC
, plot them, and extract meaning out of that.
Here's the basic code I'll fux with:
blurg[CCC_] :=
Block[
ccc = Rationalize[CCC],
Dbuy,
Dwait,
revx,
revy,
x, y
,
Dbuy = 1 - (x/y) - x*Log[y/x];
Dwait = (x/y) - x;
revx = D[(Dbuy*x + Dwait*ccc*y), x];
revy = D[(Dbuy*x + Dwait*ccc*y), y];
Solve[revx == 0, revy == 0, x, y, Reals]
]
solns =
blurg /@ Rest@Subdivide[0, 1, 100];
N[x, y /. #, 50] & /@ solns //
ListPlot[#, PlotStyle -> Map[Hue, Range[0, 1, 1/Length@solns]]] &
You can see you always have two solutions and they converge down to those end-points at CCC=1
and apparently diverge as CCC->0
You can also look at the symbolic solutions returned but they will be nasty. Lots of complicated Root
objects
Here's another fun example:
solns =
blurg /@ Rest@Subdivide[0, .01, 25];
N[x, y /. #, 50] & /@ solns //
ListPlot[#, PlotStyle -> Map[Hue, Range[0, 1, 1/Length@solns]]] &
This shows the divergence over that side of the solutions.
edited 1 hour ago
answered 1 hour ago
b3m2a1
25k254147
25k254147
add a comment |Â
add a comment |Â
Ovunc is a new contributor. Be nice, and check out our Code of Conduct.
Ovunc is a new contributor. Be nice, and check out our Code of Conduct.
Ovunc is a new contributor. Be nice, and check out our Code of Conduct.
Ovunc is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f184359%2fsolve-struggles-to-solve-equation-with-variable-constraint%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
Well, do you have any reason to expect a closed-form solution exists at all?
â AccidentalFourierTransform
2 hours ago
I feel that the root for the constraint 0<=x<=y<=1 has a closed-form. Is there a way to check it? Or is there a way to add a constraint to "Solve" function? Or is there a way to find a closed-form approximation?
â Ovunc
2 hours ago
1
In 11.3 I get a "This system cannot be solved with the methods available to Solve." message. Probably means the system cannot be solved with the methods available to Solve, no? Even if I drop the floating
CCC
I getRoot
objects parametrized near to a value.â b3m2a1
2 hours ago