0
$\begingroup$

I have define the following functions:

w[k_] := k*0.8 + (1 - k)*0.3

b[k_] := 0.3*Sqrt[k]

and I want to solve the following system of equations

optimal = {0.5*x^(-1/2) == w[k]/(p + sP), D[b[k], k]/D[w[k], k] == x*(1 - r)/r}

by calling the Solve function

Solve[optimal, {x, k}, PositiveReals]

However, $p>0$, $sP>0$ and $r\in[0,1]$. So, my question is how to tell mathematica to account for these constraints on the value of coefficients?

$\endgroup$
4
  • $\begingroup$ It does not answer your question but if your are using Solve, I would suggest adding \\ Rationalize after the definition of optimal. $\endgroup$
    – anderstood
    Commented Oct 28, 2020 at 14:47
  • $\begingroup$ Also, the condition can be simplified. If $p$ and $sP$ are positive, since $x^(-1/2)>0$, w[k] has to be positive too, Reduce[w[k] > 0 // Rationalize] returns k > -(3/5). $\endgroup$
    – anderstood
    Commented Oct 28, 2020 at 14:51
  • $\begingroup$ w[k] is always positive, since $k\in[0,1]$ $\endgroup$
    – Yorgos
    Commented Oct 28, 2020 at 14:54
  • 2
    $\begingroup$ w[k_] = k*0.8 + (1 - k) 0.3 // Rationalize; b[k_] = [email protected]*Sqrt[k] // Rationalize; optimal = {0.5*x^(-1/2) == w[k]/(p + sP), D[b[k], k]/D[w[k], k] == x*(1 - r)/r, x > 0, k > 0, p > 0, sp > 0, 0 < r < 1} // Rationalize; Reduce[optimal, {x, k}, Reals] $\endgroup$
    – cvgmt
    Commented Oct 28, 2020 at 15:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.