Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.4K Views
|
6 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Factor out known multipliers in algebraic expressions?

Posted 8 years ago
Attachments:
POSTED BY: André Barbosa
6 Replies

I am not quite sure what you want to do, but first of all in a [ t ] your "constant parameter (Ixx, Iyy, Izz)" are functions of t as well.

So I remove this

num = Numerator[a[t]] /. {Ixx[t] -> Ixx, Iyy[t] -> Iyy,  Izz[t] -> Izz} // Expand
den = Denominator[a[t]] /. {Ixx[t] -> Ixx, Iyy[t] -> Iyy,  Izz[t] -> Izz} // FullSimplify

and Collect terms

num1 = Collect[num, {Ixx, Iyy, Izz, Ixx Iyy, Ixx Izz, Iyy Izz}]

Check it

(a[t] - num1/den /. {Ixx[t] -> Ixx, Iyy[t] -> Iyy,     Izz[t] -> Izz}) // Simplify

You may well replace Ixx for Ixx [ t ] ans so on in num1 / den again....

Hope this helps.

POSTED BY: Hans Dolhaine

Another method, perhaps easier to be made more general is: Find the "variables" - meaning the expressions not being dependet of A or B

vv = Complement[Variables[y], {A, B}]

Now find the coefficients of these variables

cc = Coefficient[y, #] & /@ vv

and then find the factors of these

Collect[y, cc]
POSTED BY: Hans Dolhaine

hmmm - ok. perhaps you should disguise the mixed terms. Seems that this

Collect[y /. {A B -> ab, A/B -> adb, B/A -> bda}, {A, B, ab, adb,bda}] /. {ab -> A B, adb -> A/B, bda -> B/A}

works in your simple example, but for sure it will get tedious in more complicated cases.

And what is wrong with the method I mentioned first? This gives num1 as a polynomial in Ixx, Ixx^2, Ixx * Iyy and so on with coefficients as functions depending only of t. Same for the denominator and then you can write your a [ t ] in the form you want.

POSTED BY: Hans Dolhaine
Posted 8 years ago

Thank you!

This idea worked pretty neat! Precisely what I intended to obtain as an answer form of the equation. Very easy to understand.

Now I will try to apply those methods into a[t]. Because I need to simplify redundant functions for applying linear solving methods (non singular matrix).

I'm grateful! Thanks again.

POSTED BY: André Barbosa
Posted 8 years ago

Thanks for the help. Check the new file that I've uploaded below.

POSTED BY: André Barbosa
Posted 8 years ago

Thanks for the help! You are right, sorry for the mistake, Ixx[t] is Ixx; e this also aplies to Iyy and Izz.

However, I've tried to use it and still isn't what I want as an answer.

To put in other example,...

Let's say that I have this expression:

y = A*Cos [\[Theta]] + (B/A)*Sin[\[Theta]] + (B*A)*x + 
  A*Tan[x] + (B/A)*x^2

And, what I want to know is how to rewrite it like this, using Mathematica methods:

y = A*(Cos [\[Theta]]+Tan[x]) + (B/A)*(Sin[\[Theta]]+x^2) + (B*A)*x

Because I want "y" as a sum of the constant terms {A,B} in any combination between them, but also multiplying a function that do not include them, like above.

For example, this format o y, applying Apart for "B"

Apart[ y , {B}]

Results in:

{(B (A^2 x + x^2 + Sin[\[Theta]]))/A + A (Cos[\[Theta]] + Tan[x])}

Which doesn't help, because the first polynomial term contains "A", that I want only as a coefficient.

Thanks again for the help.

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