Message Boards Message Boards

Turn symbolic eq1 into eq2 using patterns?

Posted 5 years ago

enter image description here

eq1 = Derivative[1][H][t] == 
  H[t] (-\[Mu] B[t] - Subscript[d, e] + (
     Subscript[r, 
      e] (H[t] (Subscript[d, e] - Subscript[r, e]) + 
        Subscript[K1, e] Subscript[r, e] + 
        L[t] Subscript[k, e] (-Subscript[d, e] + Subscript[r, e])))/(
     Subscript[K1, e] Subscript[r, e] + 
      L[t] Subscript[k, e] (-Subscript[d, e] + Subscript[r, e])))

eq2 = Derivative[1][H][t] == 
  H[t] (-\[Mu] B[t] - Subscript[d, e] + Subscript[r, e] + (
     Subscript[r, e] H[t] (Subscript[d, e] - Subscript[r, e]))/(
     Subscript[K1, e] Subscript[r, e] + 
      L[t] Subscript[k, e] (-Subscript[d, e] + Subscript[r, e])))
POSTED BY: Jacques Ou
4 Replies

This is a way:

eq1 /.
  a_/b_ :> Subscript[r, e] + Factor[a/b - Subscript[r, e]] /.

 a_/b_ :> a/Collect[b, L[t]]
POSTED BY: Gianluca Gorni
Posted 5 years ago

This way is to use pattern?

POSTED BY: Jacques Ou

Yes, it uses patterns.

POSTED BY: Gianluca Gorni
Posted 5 years ago

Thanks for your help.

POSTED BY: Jacques Ou
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract