Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #7981 > unrolled thread
| Started by | Nicolas Simon <nicodumonastal@gmail.com> |
|---|---|
| First post | 2012-01-18 11:08 +0000 |
| Last post | 2012-01-21 10:15 +0000 |
| Articles | 4 — 3 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Simplification de formule/ Simplification of formula Nicolas Simon <nicodumonastal@gmail.com> - 2012-01-18 11:08 +0000
Re: Simplification de formule/ Simplification of formula "Dr. Wolfgang Hintze" <weh@snafu.de> - 2012-01-19 10:13 +0000
Re: Simplification de formule/ Simplification of formula "Dr. Wolfgang Hintze" <weh@snafu.de> - 2012-01-20 06:56 +0000
Re: Simplification de formule/ Simplification of formula Bob Hanlon <hanlonr357@gmail.com> - 2012-01-21 10:15 +0000
| From | Nicolas Simon <nicodumonastal@gmail.com> |
|---|---|
| Date | 2012-01-18 11:08 +0000 |
| Subject | Simplification de formule/ Simplification of formula |
| Message-ID | <jf696v$gdp$1@smc.vnet.net> |
Hi ! I want to simplify this formula : -((DK Pv2 Cos[a2 - alpha3] Cos[aV2] Sin[a2 - aV2])/( DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) + ( KF Pv2 Cos[aV2] Sin[a2 - alpha3] Sin[a2 - aV2])/( DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) - ( DG3 P3 Sin[alpha3] Sin[a2 - aV2])/( DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) - ( DK FV2 Pv2 Cos[a2 - alpha3] Cos[a2 - aV2] Sin[aV2])/( L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) + ( FV2 KF Pv2 Cos[a2 - aV2] Sin[a2 - alpha3] Sin[aV2])/( L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) - ( KF Pv2 Cos[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/( DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) + ( FV2 KF Pv2 Cos[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/( L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) - ( DK Pv2 Sin[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/( DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) + ( DK FV2 Pv2 Sin[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/( L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])). By manually regrouping the terms, the denominator disappears for a large number of fraction but I'm not able to reproduce this result with Simplify or others Mathematica tools to handle formula. Any suggestion of how I could do that with Mathematica ? Thank you for your help ! Bonjour, Je souhaite simplifier cette formule : -((DK Pv2 Cos[a2 - alpha3] Cos[aV2] Sin[a2 - aV2])/( DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) + ( KF Pv2 Cos[aV2] Sin[a2 - alpha3] Sin[a2 - aV2])/( DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) - ( DG3 P3 Sin[alpha3] Sin[a2 - aV2])/( DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) - ( DK FV2 Pv2 Cos[a2 - alpha3] Cos[a2 - aV2] Sin[aV2])/( L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) + ( FV2 KF Pv2 Cos[a2 - aV2] Sin[a2 - alpha3] Sin[aV2])/( L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) - ( KF Pv2 Cos[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/( DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) + ( FV2 KF Pv2 Cos[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/( L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) - ( DK Pv2 Sin[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/( DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) + ( DK FV2 Pv2 Sin[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/( L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])). En regroupant les bons termes le d=E9nominateur se simplifie pour un grand nombres de fractions mais je n'arrive pas a ce r=E9sultat avec les outils de simplification (FullSimplify ou Simplify) ou les outils de manipulations de formule. Est ce que vous auriez une id=E9e de comment faire comme pr=E9ciser certains "assumption" dans Simplify ? Merci de votre aide.
[toc] | [next] | [standalone]
| From | "Dr. Wolfgang Hintze" <weh@snafu.de> |
|---|---|
| Date | 2012-01-19 10:13 +0000 |
| Message-ID | <jf8qd2$3ld$1@smc.vnet.net> |
| In reply to | #7981 |
> I want to simplify this formula :
This is obviously a good idea and a good excercise if it comes to
obtaining an overview over a confusing looking expression.
You cannot expect fully automatic simplification, since it was not
clearly stated which should be the desired form.
So it will be a dialog between you and Mathematica.
I suggest to first to make some replacements to get better readability
(you can undo them in the end).
Then recognising the structure by eye it will almost become obvious
which commands to choose.
Ok, let's do it!
1) Let your expression be
x = -((DK*Pv2*Cos[a2 - alpha3]*Cos[aV2]*Sin[a2 - aV2])/(DK*Cos[a2 -
alpha3] - KF*Sin[a2 - alpha3])) +
(KF*Pv2*Cos[aV2]*Sin[a2 - alpha3]*Sin[a2 - aV2])/(DK*Cos[a2 - alpha3] -
KF*Sin[a2 - alpha3]) -
(DG3*P3*Sin[alpha3]*Sin[a2 - aV2])/(DK*Cos[a2 - alpha3] - KF*Sin[a2 -
alpha3]) - (DK*FV2*Pv2*Cos[a2 - alpha3]*Cos[a2 - aV2]*Sin[aV2])/
(L2*(DK*Cos[a2 - alpha3] - KF*Sin[a2 - alpha3])) + (FV2*KF*Pv2*Cos[a2 -
aV2]*Sin[a2 - alpha3]*Sin[aV2])/
(L2*(DK*Cos[a2 - alpha3] - KF*Sin[a2 - alpha3])) - (KF*Pv2*Cos[a2 -
alpha3]*Sin[a2 - aV2]*Sin[aV2])/(DK*Cos[a2 - alpha3] - KF*Sin[a2 -
alpha3]) +
(FV2*KF*Pv2*Cos[a2 - alpha3]*Sin[a2 - aV2]*Sin[aV2])/(L2*(DK*Cos[a2 -
alpha3] - KF*Sin[a2 - alpha3])) -
(DK*Pv2*Sin[a2 - alpha3]*Sin[a2 - aV2]*Sin[aV2])/(DK*Cos[a2 - alpha3] -
KF*Sin[a2 - alpha3]) + (DK*FV2*Pv2*Sin[a2 - alpha3]*Sin[a2 -
aV2]*Sin[aV2])/
(L2*(DK*Cos[a2 - alpha3] - KF*Sin[a2 - alpha3]))
2) Replacements
x1 = x /. {a2 -> a, alpha3 -> b, aV2 -> c, DK -> A, Pv2 -> B, KF -> U,
DG3 -> V, P3 -> W, FV2 -> X, L2 -> Y}
-((A*B*Cos[a - b]*Cos[c]*Sin[a - c])/(A*Cos[a - b] - U*Sin[a - b])) +
(B*U*Cos[c]*Sin[a - b]*Sin[a - c])/(A*Cos[a - b] - U*Sin[a - b]) -
(V*W*Sin[b]*Sin[a - c])/(A*Cos[a - b] - U*Sin[a - b]) - (A*B*X*Cos[a -
b]*Cos[a - c]*Sin[c])/(Y*(A*Cos[a - b] - U*Sin[a - b])) +
(B*U*X*Cos[a - c]*Sin[a - b]*Sin[c])/(Y*(A*Cos[a - b] - U*Sin[a -
b])) - (B*U*Cos[a - b]*Sin[a - c]*Sin[c])/(A*Cos[a - b] - U*Sin[a - b])
+
(B*U*X*Cos[a - b]*Sin[a - c]*Sin[c])/(Y*(A*Cos[a - b] - U*Sin[a -
b])) - (A*B*Sin[a - b]*Sin[a - c]*Sin[c])/(A*Cos[a - b] - U*Sin[a - b])
+
(A*B*X*Sin[a - b]*Sin[a - c]*Sin[c])/(Y*(A*Cos[a - b] - U*Sin[a - b]))
By the way, this expression looks much nicer in Mathematica than in
this mail here.
3) Seeing the common denominator we tell Mathematica to extract it
x2 = Collect[x1, A*Cos[a - b] - U*Sin[a - b]]
(1/(A*Cos[a - b] - U*Sin[a - b]))*((-A)*B*Cos[a - b]*Cos[c]*Sin[a - c]
+ B*U*Cos[c]*Sin[a - b]*Sin[a - c] - V*W*Sin[b]*Sin[a - c] -
(A*B*X*Cos[a - b]*Cos[a - c]*Sin[c])/Y + (B*U*X*Cos[a - c]*Sin[a -
b]*Sin[c])/Y - B*U*Cos[a - b]*Sin[a - c]*Sin[c] +
(B*U*X*Cos[a - b]*Sin[a - c]*Sin[c])/Y - A*B*Sin[a - b]*Sin[a -
c]*Sin[c] + (A*B*X*Sin[a - b]*Sin[a - c]*Sin[c])/Y)
Again this expression looks much nicer in Mathematica than in this mail
here.
4) Trying to extrax 1/Y using collect didn't improve things so we try a
Simplify in the end
x3 = Simplify[x2]
-((1/(2*Y*(A*Cos[a - b] - U*Sin[a - b])))*(B*U*X*Cos[2*a - b] -
B*U*Y*Cos[b] - B*U*X*Cos[2*a - b - 2*c] + B*U*Y*Cos[2*a - b - 2*c] +
V*W*Y*Cos[a - b - c] -
V*W*Y*Cos[a + b - c] + A*B*X*Sin[2*a - b] + A*B*Y*Sin[b] -
A*B*X*Sin[2*a - b - 2*c] + A*B*Y*Sin[2*a - b - 2*c]))
This seems to be a rather good result:
- one common denominator extracted
- all terms in the big bracket have the same structure A*B*C Trig[...]
- angles collected under the Trigfunctions
PS: here is a little additional exercise: how would you invert the
replacements 2) efficiently?
Hope this helps
Best regards,
Wolfgang
"Nicolas Simon" <nicodumonastal@gmail.com> schrieb im Newsbeitrag
news:jf696v$gdp$1@smc.vnet.net...
>
> Hi !
>
> I want to simplify this formula :
>
> -((DK Pv2 Cos[a2 - alpha3] Cos[aV2] Sin[a2 - aV2])/(
> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) + (
> KF Pv2 Cos[aV2] Sin[a2 - alpha3] Sin[a2 - aV2])/(
> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) - (
> DG3 P3 Sin[alpha3] Sin[a2 - aV2])/(
> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) - (
> DK FV2 Pv2 Cos[a2 - alpha3] Cos[a2 - aV2] Sin[aV2])/(
> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) + (
> FV2 KF Pv2 Cos[a2 - aV2] Sin[a2 - alpha3] Sin[aV2])/(
> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) - (
> KF Pv2 Cos[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) + (
> FV2 KF Pv2 Cos[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) - (
> DK Pv2 Sin[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) + (
> DK FV2 Pv2 Sin[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])).
>
> By manually regrouping the terms, the denominator disappears for a
> large number of fraction but I'm not able to reproduce this result
> with Simplify or others Mathematica tools to handle formula. Any
> suggestion of how I could do that with Mathematica ?
> Thank you for your help !
>
>
>
>
>
>
>
>
>
> Bonjour,
>
> Je souhaite simplifier cette formule :
>
> -((DK Pv2 Cos[a2 - alpha3] Cos[aV2] Sin[a2 - aV2])/(
> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) + (
> KF Pv2 Cos[aV2] Sin[a2 - alpha3] Sin[a2 - aV2])/(
> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) - (
> DG3 P3 Sin[alpha3] Sin[a2 - aV2])/(
> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) - (
> DK FV2 Pv2 Cos[a2 - alpha3] Cos[a2 - aV2] Sin[aV2])/(
> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) + (
> FV2 KF Pv2 Cos[a2 - aV2] Sin[a2 - alpha3] Sin[aV2])/(
> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) - (
> KF Pv2 Cos[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) + (
> FV2 KF Pv2 Cos[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) - (
> DK Pv2 Sin[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) + (
> DK FV2 Pv2 Sin[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])).
>
> En regroupant les bons termes le d=E9nominateur se simplifie pour un
> grand nombres de fractions mais je n'arrive pas a ce r=E9sultat avec
> les
> outils de simplification (FullSimplify ou Simplify) ou les outils de
> manipulations de formule. Est ce que vous auriez une id=E9e de
> comment
> faire comme pr=E9ciser certains "assumption" dans Simplify ?
> Merci de votre aide.
>
[toc] | [prev] | [next] | [standalone]
| From | "Dr. Wolfgang Hintze" <weh@snafu.de> |
|---|---|
| Date | 2012-01-20 06:56 +0000 |
| Message-ID | <jfb367$hrh$1@smc.vnet.net> |
| In reply to | #7999 |
Here's a possible solution to the problem of inverting replacement
rules.
In[42]:=
r = {a -> b}; s = {a -> b, c -> d};
In[40]:=
(Rule @@ Sequence[Reverse[List @@ #1]] & ) /@ r
Out[40]=
{b -> a}
In[41]:=
(Rule @@ Sequence[Reverse[List @@ #1]] & ) /@ s
Out[41]=
{b -> a, d -> c}
For a "naked" rule (not in a list) you should use
In[43]:=
t = u -> v;
(Rule @@ Sequence[Reverse[List @@ #1]] & )[t]
Out[44]=
v -> u
Regards,
Wolfgang
"Dr. Wolfgang Hintze" <weh@snafu.de> schrieb im Newsbeitrag
news:jf8qd2$3ld$1@smc.vnet.net...
>> I want to simplify this formula :
>
> This is obviously a good idea and a good excercise if it comes to
> obtaining an overview over a confusing looking expression.
>
> You cannot expect fully automatic simplification, since it was not
> clearly stated which should be the desired form.
> So it will be a dialog between you and Mathematica.
>
> I suggest to first to make some replacements to get better
> readability
> (you can undo them in the end).
> Then recognising the structure by eye it will almost become obvious
> which commands to choose.
>
> Ok, let's do it!
>
> 1) Let your expression be
>
> x = -((DK*Pv2*Cos[a2 - alpha3]*Cos[aV2]*Sin[a2 - aV2])/(DK*Cos[a2 -
> alpha3] - KF*Sin[a2 - alpha3])) +
> (KF*Pv2*Cos[aV2]*Sin[a2 - alpha3]*Sin[a2 - aV2])/(DK*Cos[a2 -
> alpha3] -
> KF*Sin[a2 - alpha3]) -
> (DG3*P3*Sin[alpha3]*Sin[a2 - aV2])/(DK*Cos[a2 - alpha3] - KF*Sin[a2 -
> alpha3]) - (DK*FV2*Pv2*Cos[a2 - alpha3]*Cos[a2 - aV2]*Sin[aV2])/
> (L2*(DK*Cos[a2 - alpha3] - KF*Sin[a2 - alpha3])) +
> (FV2*KF*Pv2*Cos[a2 -
> aV2]*Sin[a2 - alpha3]*Sin[aV2])/
> (L2*(DK*Cos[a2 - alpha3] - KF*Sin[a2 - alpha3])) - (KF*Pv2*Cos[a2 -
> alpha3]*Sin[a2 - aV2]*Sin[aV2])/(DK*Cos[a2 - alpha3] - KF*Sin[a2 -
> alpha3]) +
> (FV2*KF*Pv2*Cos[a2 - alpha3]*Sin[a2 - aV2]*Sin[aV2])/(L2*(DK*Cos[a2 -
> alpha3] - KF*Sin[a2 - alpha3])) -
> (DK*Pv2*Sin[a2 - alpha3]*Sin[a2 - aV2]*Sin[aV2])/(DK*Cos[a2 -
> alpha3] -
> KF*Sin[a2 - alpha3]) + (DK*FV2*Pv2*Sin[a2 - alpha3]*Sin[a2 -
> aV2]*Sin[aV2])/
> (L2*(DK*Cos[a2 - alpha3] - KF*Sin[a2 - alpha3]))
>
> 2) Replacements
>
> x1 = x /. {a2 -> a, alpha3 -> b, aV2 -> c, DK -> A, Pv2 -> B, KF ->
> U,
> DG3 -> V, P3 -> W, FV2 -> X, L2 -> Y}
>
> -((A*B*Cos[a - b]*Cos[c]*Sin[a - c])/(A*Cos[a - b] - U*Sin[a - b])) +
> (B*U*Cos[c]*Sin[a - b]*Sin[a - c])/(A*Cos[a - b] - U*Sin[a - b]) -
> (V*W*Sin[b]*Sin[a - c])/(A*Cos[a - b] - U*Sin[a - b]) -
> (A*B*X*Cos[a -
> b]*Cos[a - c]*Sin[c])/(Y*(A*Cos[a - b] - U*Sin[a - b])) +
> (B*U*X*Cos[a - c]*Sin[a - b]*Sin[c])/(Y*(A*Cos[a - b] - U*Sin[a -
> b])) - (B*U*Cos[a - b]*Sin[a - c]*Sin[c])/(A*Cos[a - b] - U*Sin[a -
> b])
> +
> (B*U*X*Cos[a - b]*Sin[a - c]*Sin[c])/(Y*(A*Cos[a - b] - U*Sin[a -
> b])) - (A*B*Sin[a - b]*Sin[a - c]*Sin[c])/(A*Cos[a - b] - U*Sin[a -
> b])
> +
> (A*B*X*Sin[a - b]*Sin[a - c]*Sin[c])/(Y*(A*Cos[a - b] - U*Sin[a -
> b]))
>
> By the way, this expression looks much nicer in Mathematica than in
> this mail here.
>
> 3) Seeing the common denominator we tell Mathematica to extract it
> x2 = Collect[x1, A*Cos[a - b] - U*Sin[a - b]]
>
> (1/(A*Cos[a - b] - U*Sin[a - b]))*((-A)*B*Cos[a - b]*Cos[c]*Sin[a -
> c]
> + B*U*Cos[c]*Sin[a - b]*Sin[a - c] - V*W*Sin[b]*Sin[a - c] -
> (A*B*X*Cos[a - b]*Cos[a - c]*Sin[c])/Y + (B*U*X*Cos[a - c]*Sin[a -
> b]*Sin[c])/Y - B*U*Cos[a - b]*Sin[a - c]*Sin[c] +
> (B*U*X*Cos[a - b]*Sin[a - c]*Sin[c])/Y - A*B*Sin[a - b]*Sin[a -
> c]*Sin[c] + (A*B*X*Sin[a - b]*Sin[a - c]*Sin[c])/Y)
>
> Again this expression looks much nicer in Mathematica than in this
> mail
> here.
>
> 4) Trying to extrax 1/Y using collect didn't improve things so we try
> a
> Simplify in the end
>
> x3 = Simplify[x2]
>
> -((1/(2*Y*(A*Cos[a - b] - U*Sin[a - b])))*(B*U*X*Cos[2*a - b] -
> B*U*Y*Cos[b] - B*U*X*Cos[2*a - b - 2*c] + B*U*Y*Cos[2*a - b - 2*c] +
> V*W*Y*Cos[a - b - c] -
> V*W*Y*Cos[a + b - c] + A*B*X*Sin[2*a - b] + A*B*Y*Sin[b] -
> A*B*X*Sin[2*a - b - 2*c] + A*B*Y*Sin[2*a - b - 2*c]))
>
> This seems to be a rather good result:
>
> - one common denominator extracted
> - all terms in the big bracket have the same structure A*B*C
> Trig[...]
> - angles collected under the Trigfunctions
>
> PS: here is a little additional exercise: how would you invert the
> replacements 2) efficiently?
>
> Hope this helps
> Best regards,
> Wolfgang
>
>
> "Nicolas Simon" <nicodumonastal@gmail.com> schrieb im Newsbeitrag
> news:jf696v$gdp$1@smc.vnet.net...
>>
>> Hi !
>>
>> I want to simplify this formula :
>>
>> -((DK Pv2 Cos[a2 - alpha3] Cos[aV2] Sin[a2 - aV2])/(
>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) + (
>> KF Pv2 Cos[aV2] Sin[a2 - alpha3] Sin[a2 - aV2])/(
>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) - (
>> DG3 P3 Sin[alpha3] Sin[a2 - aV2])/(
>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) - (
>> DK FV2 Pv2 Cos[a2 - alpha3] Cos[a2 - aV2] Sin[aV2])/(
>> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) + (
>> FV2 KF Pv2 Cos[a2 - aV2] Sin[a2 - alpha3] Sin[aV2])/(
>> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) - (
>> KF Pv2 Cos[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) + (
>> FV2 KF Pv2 Cos[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
>> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) - (
>> DK Pv2 Sin[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) + (
>> DK FV2 Pv2 Sin[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
>> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])).
>>
>> By manually regrouping the terms, the denominator disappears for a
>> large number of fraction but I'm not able to reproduce this result
>> with Simplify or others Mathematica tools to handle formula. Any
>> suggestion of how I could do that with Mathematica ?
>> Thank you for your help !
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Bonjour,
>>
>> Je souhaite simplifier cette formule :
>>
>> -((DK Pv2 Cos[a2 - alpha3] Cos[aV2] Sin[a2 - aV2])/(
>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) + (
>> KF Pv2 Cos[aV2] Sin[a2 - alpha3] Sin[a2 - aV2])/(
>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) - (
>> DG3 P3 Sin[alpha3] Sin[a2 - aV2])/(
>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) - (
>> DK FV2 Pv2 Cos[a2 - alpha3] Cos[a2 - aV2] Sin[aV2])/(
>> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) + (
>> FV2 KF Pv2 Cos[a2 - aV2] Sin[a2 - alpha3] Sin[aV2])/(
>> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) - (
>> KF Pv2 Cos[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) + (
>> FV2 KF Pv2 Cos[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
>> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) - (
>> DK Pv2 Sin[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) + (
>> DK FV2 Pv2 Sin[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
>> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])).
>>
>> En regroupant les bons termes le d=E9nominateur se simplifie pour un
>> grand nombres de fractions mais je n'arrive pas a ce r=E9sultat avec
>> les
>> outils de simplification (FullSimplify ou Simplify) ou les outils de
>> manipulations de formule. Est ce que vous auriez une id=E9e de
>> comment
>> faire comme pr=E9ciser certains "assumption" dans Simplify ?
>> Merci de votre aide.
>>
>
>
[toc] | [prev] | [next] | [standalone]
| From | Bob Hanlon <hanlonr357@gmail.com> |
|---|---|
| Date | 2012-01-21 10:15 +0000 |
| Message-ID | <jfe38l$9s3$1@smc.vnet.net> |
| In reply to | #7981 |
Reverse is not limited to reversing lists:
r = {a -> b}; s = {a -> b, c -> d};
Reverse /@ r
{b -> a}
Reverse /@ s
{b -> a, d -> c}
Bob Hanlon
On Fri, Jan 20, 2012 at 1:52 AM, Dr. Wolfgang Hintze <weh@snafu.de> wrote:
> Here's a possible solution to the problem of inverting replacement
> rules.
>
>
> In[42]:=
> r = {a -> b}; s = {a -> b, c -> d};
> In[40]:=
> (Rule @@ Sequence[Reverse[List @@ #1]] & ) /@ r
> Out[40]=
> {b -> a}
> In[41]:=
> (Rule @@ Sequence[Reverse[List @@ #1]] & ) /@ s
> Out[41]=
> {b -> a, d -> c}
>
> For a "naked" rule (not in a list) you should use
>
> In[43]:=
> t = u -> v;
> (Rule @@ Sequence[Reverse[List @@ #1]] & )[t]
> Out[44]=
> v -> u
>
> Regards,
> Wolfgang
>
> "Dr. Wolfgang Hintze" <weh@snafu.de> schrieb im Newsbeitrag
> news:jf8qd2$3ld$1@smc.vnet.net...
>>> I want to simplify this formula :
>>
>> This is obviously a good idea and a good excercise if it comes to
>> obtaining an overview over a confusing looking expression.
>>
>> You cannot expect fully automatic simplification, since it was not
>> clearly stated which should be the desired form.
>> So it will be a dialog between you and Mathematica.
>>
>> I suggest to first to make some replacements to get better
>> readability
>> (you can undo them in the end).
>> Then recognising the structure by eye it will almost become obvious
>> which commands to choose.
>>
>> Ok, let's do it!
>>
>> 1) Let your expression be
>>
>> x = -((DK*Pv2*Cos[a2 - alpha3]*Cos[aV2]*Sin[a2 - aV2])/(DK*Cos[a2 -
>> alpha3] - KF*Sin[a2 - alpha3])) +
>> (KF*Pv2*Cos[aV2]*Sin[a2 - alpha3]*Sin[a2 - aV2])/(DK*Cos[a2 -
>> alpha3] -
>> KF*Sin[a2 - alpha3]) -
>> (DG3*P3*Sin[alpha3]*Sin[a2 - aV2])/(DK*Cos[a2 - alpha3] - KF*Sin[a2 -
>> alpha3]) - (DK*FV2*Pv2*Cos[a2 - alpha3]*Cos[a2 - aV2]*Sin[aV2])/
>> (L2*(DK*Cos[a2 - alpha3] - KF*Sin[a2 - alpha3])) +
>> (FV2*KF*Pv2*Cos[a2 -
>> aV2]*Sin[a2 - alpha3]*Sin[aV2])/
>> (L2*(DK*Cos[a2 - alpha3] - KF*Sin[a2 - alpha3])) - (KF*Pv2*Cos[a2 -
>> alpha3]*Sin[a2 - aV2]*Sin[aV2])/(DK*Cos[a2 - alpha3] - KF*Sin[a2 -
>> alpha3]) +
>> (FV2*KF*Pv2*Cos[a2 - alpha3]*Sin[a2 - aV2]*Sin[aV2])/(L2*(DK*Cos[a2 -
>> alpha3] - KF*Sin[a2 - alpha3])) -
>> (DK*Pv2*Sin[a2 - alpha3]*Sin[a2 - aV2]*Sin[aV2])/(DK*Cos[a2 -
>> alpha3] -
>> KF*Sin[a2 - alpha3]) + (DK*FV2*Pv2*Sin[a2 - alpha3]*Sin[a2 -
>> aV2]*Sin[aV2])/
>> (L2*(DK*Cos[a2 - alpha3] - KF*Sin[a2 - alpha3]))
>>
>> 2) Replacements
>>
>> x1 = x /. {a2 -> a, alpha3 -> b, aV2 -> c, DK -> A, Pv2 -> B, KF ->
>> U,
>> DG3 -> V, P3 -> W, FV2 -> X, L2 -> Y}
>>
>> -((A*B*Cos[a - b]*Cos[c]*Sin[a - c])/(A*Cos[a - b] - U*Sin[a - b])) +
>> (B*U*Cos[c]*Sin[a - b]*Sin[a - c])/(A*Cos[a - b] - U*Sin[a - b]) -
>> (V*W*Sin[b]*Sin[a - c])/(A*Cos[a - b] - U*Sin[a - b]) -
>> (A*B*X*Cos[a -
>> b]*Cos[a - c]*Sin[c])/(Y*(A*Cos[a - b] - U*Sin[a - b])) +
>> (B*U*X*Cos[a - c]*Sin[a - b]*Sin[c])/(Y*(A*Cos[a - b] - U*Sin[a -
>> b])) - (B*U*Cos[a - b]*Sin[a - c]*Sin[c])/(A*Cos[a - b] - U*Sin[a -
>> b])
>> +
>> (B*U*X*Cos[a - b]*Sin[a - c]*Sin[c])/(Y*(A*Cos[a - b] - U*Sin[a -
>> b])) - (A*B*Sin[a - b]*Sin[a - c]*Sin[c])/(A*Cos[a - b] - U*Sin[a -
>> b])
>> +
>> (A*B*X*Sin[a - b]*Sin[a - c]*Sin[c])/(Y*(A*Cos[a - b] - U*Sin[a -
>> b]))
>>
>> By the way, this expression looks much nicer in Mathematica than in
>> this mail here.
>>
>> 3) Seeing the common denominator we tell Mathematica to extract it
>> x2 = Collect[x1, A*Cos[a - b] - U*Sin[a - b]]
>>
>> (1/(A*Cos[a - b] - U*Sin[a - b]))*((-A)*B*Cos[a - b]*Cos[c]*Sin[a -
>> c]
>> + B*U*Cos[c]*Sin[a - b]*Sin[a - c] - V*W*Sin[b]*Sin[a - c] -
>> (A*B*X*Cos[a - b]*Cos[a - c]*Sin[c])/Y + (B*U*X*Cos[a - c]*Sin[a -
>> b]*Sin[c])/Y - B*U*Cos[a - b]*Sin[a - c]*Sin[c] +
>> (B*U*X*Cos[a - b]*Sin[a - c]*Sin[c])/Y - A*B*Sin[a - b]*Sin[a -
>> c]*Sin[c] + (A*B*X*Sin[a - b]*Sin[a - c]*Sin[c])/Y)
>>
>> Again this expression looks much nicer in Mathematica than in this
>> mail
>> here.
>>
>> 4) Trying to extrax 1/Y using collect didn't improve things so we try
>> a
>> Simplify in the end
>>
>> x3 = Simplify[x2]
>>
>> -((1/(2*Y*(A*Cos[a - b] - U*Sin[a - b])))*(B*U*X*Cos[2*a - b] -
>> B*U*Y*Cos[b] - B*U*X*Cos[2*a - b - 2*c] + B*U*Y*Cos[2*a - b - 2*c] +
>> V*W*Y*Cos[a - b - c] -
>> V*W*Y*Cos[a + b - c] + A*B*X*Sin[2*a - b] + A*B*Y*Sin[b] -
>> A*B*X*Sin[2*a - b - 2*c] + A*B*Y*Sin[2*a - b - 2*c]))
>>
>> This seems to be a rather good result:
>>
>> - one common denominator extracted
>> - all terms in the big bracket have the same structure A*B*C
>> Trig[...]
>> - angles collected under the Trigfunctions
>>
>> PS: here is a little additional exercise: how would you invert the
>> replacements 2) efficiently?
>>
>> Hope this helps
>> Best regards,
>> Wolfgang
>>
>>
>> "Nicolas Simon" <nicodumonastal@gmail.com> schrieb im Newsbeitrag
>> news:jf696v$gdp$1@smc.vnet.net...
>>>
>>> Hi !
>>>
>>> I want to simplify this formula :
>>>
>>> -((DK Pv2 Cos[a2 - alpha3] Cos[aV2] Sin[a2 - aV2])/(
>>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) + (
>>> KF Pv2 Cos[aV2] Sin[a2 - alpha3] Sin[a2 - aV2])/(
>>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) - (
>>> DG3 P3 Sin[alpha3] Sin[a2 - aV2])/(
>>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) - (
>>> DK FV2 Pv2 Cos[a2 - alpha3] Cos[a2 - aV2] Sin[aV2])/(
>>> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) + (
>>> FV2 KF Pv2 Cos[a2 - aV2] Sin[a2 - alpha3] Sin[aV2])/(
>>> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) - (
>>> KF Pv2 Cos[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
>>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) + (
>>> FV2 KF Pv2 Cos[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
>>> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) - (
>>> DK Pv2 Sin[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
>>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) + (
>>> DK FV2 Pv2 Sin[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
>>> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])).
>>>
>>> By manually regrouping the terms, the denominator disappears for a
>>> large number of fraction but I'm not able to reproduce this result
>>> with Simplify or others Mathematica tools to handle formula. Any
>>> suggestion of how I could do that with Mathematica ?
>>> Thank you for your help !
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Bonjour,
>>>
>>> Je souhaite simplifier cette formule :
>>>
>>> -((DK Pv2 Cos[a2 - alpha3] Cos[aV2] Sin[a2 - aV2])/(
>>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) + (
>>> KF Pv2 Cos[aV2] Sin[a2 - alpha3] Sin[a2 - aV2])/(
>>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) - (
>>> DG3 P3 Sin[alpha3] Sin[a2 - aV2])/(
>>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) - (
>>> DK FV2 Pv2 Cos[a2 - alpha3] Cos[a2 - aV2] Sin[aV2])/(
>>> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) + (
>>> FV2 KF Pv2 Cos[a2 - aV2] Sin[a2 - alpha3] Sin[aV2])/(
>>> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) - (
>>> KF Pv2 Cos[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
>>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) + (
>>> FV2 KF Pv2 Cos[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
>>> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])) - (
>>> DK Pv2 Sin[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
>>> DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3]) + (
>>> DK FV2 Pv2 Sin[a2 - alpha3] Sin[a2 - aV2] Sin[aV2])/(
>>> L2 (DK Cos[a2 - alpha3] - KF Sin[a2 - alpha3])).
>>>
>>> En regroupant les bons termes le d=E9nominateur se simplifie pour un
>>> grand nombres de fractions mais je n'arrive pas a ce r=E9sultat avec
>>> les
>>> outils de simplification (FullSimplify ou Simplify) ou les outils de
>>> manipulations de formule. Est ce que vous auriez une id=E9e de
>>> comment
>>> faire comme pr=E9ciser certains "assumption" dans Simplify ?
>>> Merci de votre aide.
>>>
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web