8
$\begingroup$

I'm trying to solve some equations and i would like know if it is possible to have the Solve or Eliminate-function arrange the solution in a specific pattern.

Example

In this example you can see that if you plug equations (2) and (3) into equation (1) and rearrange it a little bit, the first term becomes the kinetic energy and the second term is the power coefficient. I would like to tell Mathematica to include the kinetic energy term in the solution. I was thinking about something like this:

Eliminate[equations, {mDot, v2}, MatchPattern -> ERot == (1/2)*rho*A*v1^3*___]

Is there any way to make this possible? Any help or comment is greatly appreciated!

$\endgroup$

1 Answer 1

9
$\begingroup$
Clear["Global`*"]

eq1 = ERot == 1/2 m(v1^2 - v3^2);

eq2 = m == ρ A v2;

eq3 = v2 == (v1 + v3)/2;

To force use of the ratio v3/v1 use

eq4 = v31 == v3/v1;

Solve for ERot while eliminating {m, v2, v3}

(eq5 = (Solve[{eq1, eq2, eq3, eq4}, ERot, {m, v2, v3}][[1, 1]] // 
        Simplify) /.
      {a_*(b_ - 1) -> -a*(1 - b)} /.
     {v31 -> v3/v1, Rule -> Equal}) //
 TraditionalForm

(* ERot==1/4 A ρ v1^3 (1-v3/v1) (v3/v1+1)^2 *)

Checking,

eq1 === (Solve[{eq5, eq2, eq3}, ERot, {A, v2}][[1, 1]] /.
   Rule -> Equal)

(* True *)

To split the factor 1/4 you would need to Hold the subexpressions. You should check your result for the power coefficient.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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