0
$\begingroup$

I have the following equations

Subscript[NE, t] == Subscript[X, t]/(γ*σ^2)


Subscript[NF, t] == (Subscript[D, t] - (T - t - 1)*γ*σ^2*Q - Subscript[P,t])/(γ*σ^2)

uf == 1 - ue

Q == ue*Subscript[NE, t] + uf*Subscript[NF, t]

I would like to solve for Subscript[P,t]

When I use the Reduce function I get the following output:

ue + uf == 1 && 
 Q == ue Subscript[NE, t] + 
   uf Subscript[NF, 
    t] && ((γ σ != 0 && Subscript[NE, t] == 0 && 
     Subscript[X, t] == 
      0) || (σ Subscript[NE, t] Subscript[X, t] != 
      0 && γ == Subscript[X, 
      t]/(σ^2 Subscript[NE, t]))) && 
 Subscript[P, t] == 
  Subscript[D, 
   t] + γ σ^2 (Q (1 + t - T) - Subscript[NF, t])

Which is not the correct solution.

When I try using the Solve function I get an empty output. What am I doing wrong? Are Reduce and Solve not correct to use here?

$\endgroup$
1
  • 1
    $\begingroup$ I dont have time to give a full answer, but please rewrite all of your code variables that have a subscript with just Pt or Dt and etc...and your code will likley work, unfortunatel subscript is kinda a trap for new users...also ‘D’ id a protected letter and means D[] and will cause failures when using as a variable alone...same as “I” if you dont intend to work with complex values! Good luck. $\endgroup$ Commented Jun 18, 2019 at 20:20

1 Answer 1

0
$\begingroup$

You can use Solve with a 3rd argument specifying which variables to eliminate:

Solve[
    {
    Subscript[NE,t]==Subscript[X,t]/(γ*σ^2),
    Subscript[NF,t]==(Subscript[D,t]-(T-t-1)*γ*σ^2*Q-Subscript[P,t])/(γ*σ^2),
    uf==1-ue,
    Q==ue*Subscript[NE,t]+uf*Subscript[NF,t]
    },
    Subscript[P, t],
    {uf, Q, Subscript[NE, t]}
]

{{Subscript[P, t] -> -γ σ^2 (-(Subscript[D, t]/(γ σ^2)) + Subscript[NF, t] - (-1 - t + T) ((-1 + ue) Subscript[NF, t] - ( ue Subscript[X, t])/(γ σ^2)))}}

Addendum

If you eliminate ue, Subscript[NE,t] and Subscript[NF,t], then after a simple replacement you will arrive at the solution from your paper:

Solve[
    {
    Subscript[NE,t]==Subscript[X,t]/(γ*σ^2),
    Subscript[NF,t]==(Subscript[D,t]-(T-t-1)*γ*σ^2*Q-Subscript[P,t])/(γ*σ^2),
    uf==1-ue,
    Q==ue*Subscript[NE,t]+uf*Subscript[NF,t]
    },
    Subscript[P, t],
    {ue, Subscript[NF, t], Subscript[NE, t]}
] /. Subscript[X, t] - uf Subscript[X, t] -> ue Subscript[X, t]

{{Subscript[P, t] -> (-Q γ σ^2 + Q uf γ σ^2 + Q t uf γ σ^2 - Q T uf γ σ^2 + uf Subscript[D, t] + ue Subscript[X, t])/uf}}

$\endgroup$
6
  • $\begingroup$ thank you! Any idea why I cant eliminate Subscript[NF, t] and Subscript[NE, t]? $\endgroup$
    – Jj Blevins
    Commented Jun 18, 2019 at 20:30
  • $\begingroup$ @JjBlevins You have 4 equations, so you need to eliminate 3 variables. Which variable were you trying to eliminate in addition to Subscript[NF,t] and Subscript[NE,t]? $\endgroup$
    – Carl Woll
    Commented Jun 18, 2019 at 20:40
  • $\begingroup$ Q was the third. $\endgroup$
    – Jj Blevins
    Commented Jun 18, 2019 at 20:44
  • $\begingroup$ @JjBlevins If you use Eliminate[eqns, {Subscript[NE,1], Subscript[NF,1], Q}] you will see that both Q and Subscript[P, t] have also been eliminated. $\endgroup$
    – Carl Woll
    Commented Jun 18, 2019 at 20:46
  • $\begingroup$ According to the paper I got this problem from the right solution should be: Subscript[P, t] = Subscript[D, t] + (ue/uf)*Subscript[X, t] - \[Gamma]*\[Sigma]^2*Q*(T - t - 1 + 1/(uf)) $\endgroup$
    – Jj Blevins
    Commented Jun 18, 2019 at 20:50

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.