Question: How to re-write expressions in terms of each other in the most compact way?

I think some form of simplify() would do but I am not sure how.

See the following script for more details:

restart

#Define the assumptions ex-ante (variances as real and positive, correlations in between -1 and +1 and so on...) - or Maple wouldn't know

assume(`#msub(mi("mu",fontstyle = "normal"),mi("1"))`::real, `#msub(mi("mu",fontstyle = "normal"),mi("2"))`::real, `#msub(mi("mu",fontstyle = "normal"),mi("3"))`::real, `#msub(mi("lambda",fontstyle = "normal"),mi("1"))`::real, `#msub(mi("lambda",fontstyle = "normal"),mi("2"))`::real, `#msub(mi("lambda",fontstyle = "normal"),mi("3"))`::real, `#msub(mi("sigma",fontstyle = "normal"),mi("epsilon1"))`::real, `#msub(mi("sigma",fontstyle = "normal"),mi("epsilon2"))`::real, (`#msub(mi("nu",fontstyle = "normal"),mi("0"))`[1])::real, (`#msub(mi("nu",fontstyle = "normal"),mi("0"))`[2])::real, (`#msub(mi("rho",fontstyle = "normal"),mi("u"))`[1, 2])::real, (`#msub(mi("rho",fontstyle = "normal"),mi("u"))`[1, 3])::real, (`#msub(mi("rho",fontstyle = "normal"),mi("u"))`[2, 3])::real, (`#msub(mi("rho",fontstyle = "normal"),mi("v"))`[1, 2])::real, (`#msub(mi("sigma",fontstyle = "normal"),mi("u"))`[1])::real, (`#msub(mi("sigma",fontstyle = "normal"),mi("u"))`[2])::real, (`#msub(mi("sigma",fontstyle = "normal"),mi("u"))`[3])::real, (`#msub(mi("sigma",fontstyle = "normal"),mi("v"))`[1])::real, (`#msub(mi("sigma",fontstyle = "normal"),mi("v"))`[2])::real)
 

assume(0 <= `#msub(mi("mu",fontstyle = "normal"),mi("1"))`, 0 <= `#msub(mi("mu",fontstyle = "normal"),mi("2"))`, 0 <= `#msub(mi("mu",fontstyle = "normal"),mi("3"))`, 0 <= `#msub(mi("lambda",fontstyle = "normal"),mi("1"))`, 0 <= `#msub(mi("lambda",fontstyle = "normal"),mi("2"))`, 0 <= `#msub(mi("lambda",fontstyle = "normal"),mi("3"))`, 0 <= `#msub(mi("sigma",fontstyle = "normal"),mi("epsilon1"))`, 0 <= `#msub(mi("sigma",fontstyle = "normal"),mi("epsilon2"))`, 0 <= `#msub(mi("nu",fontstyle = "normal"),mi("0"))`[1], 0 <= `#msub(mi("nu",fontstyle = "normal"),mi("0"))`[2], -1 <= `#msub(mi("rho",fontstyle = "normal"),mi("u"))`[1, 2] and `#msub(mi("rho",fontstyle = "normal"),mi("u"))`[1, 2] <= 1, -1 <= `#msub(mi("rho",fontstyle = "normal"),mi("u"))`[1, 3] and `#msub(mi("rho",fontstyle = "normal"),mi("u"))`[1, 3] <= 1, -1 <= `#msub(mi("rho",fontstyle = "normal"),mi("u"))`[2, 3] and `#msub(mi("rho",fontstyle = "normal"),mi("u"))`[2, 3] <= 1, -1 <= `#msub(mi("rho",fontstyle = "normal"),mi("v"))`[1, 2] and `#msub(mi("rho",fontstyle = "normal"),mi("v"))`[1, 2] <= 1, 0 <= `#msub(mi("sigma",fontstyle = "normal"),mi("u"))`[1], 0 <= `#msub(mi("sigma",fontstyle = "normal"),mi("u"))`[2], 0 <= `#msub(mi("sigma",fontstyle = "normal"),mi("u"))`[3], 0 <= `#msub(mi("sigma",fontstyle = "normal"),mi("v"))`[1], 0 <= `#msub(mi("sigma",fontstyle = "normal"),mi("v"))`[2])

NULL

t__1 := (`&sigma;__v`[2]^2*(`&rho;__v`[1, 2]^2-1)-`&sigma;__&epsilon;2`^2)*`&sigma;__v`[1]^2/((`&sigma;__v`[2]^2*(`&rho;__v`[1, 2]^2-1)-`&sigma;__&epsilon;2`^2)*`&sigma;__v`[1]^2-`&sigma;__&epsilon;1`^2*(`&sigma;__&epsilon;2`^2+`&sigma;__v`[2]^2))

t__2 := -`&sigma;__v`[1]*`&rho;__v`[1, 2]*`&sigma;__v`[2]*`&sigma;__&epsilon;1`^2/((`&sigma;__v`[2]^2*(`&rho;__v`[1, 2]^2-1)-`&sigma;__&epsilon;2`^2)*`&sigma;__v`[1]^2-`&sigma;__&epsilon;1`^2*(`&sigma;__&epsilon;2`^2+`&sigma;__v`[2]^2))

t__3 := (`&sigma;__v`[1]*`&rho;__v`[1, 2]*`&sigma;__v`[2]*`&sigma;__&epsilon;1`^2*`&nu;__0`[2]-`&nu;__0`[1]*`&sigma;__&epsilon;1`^2*(`&sigma;__&epsilon;2`^2+`&sigma;__v`[2]^2))/((`&sigma;__v`[2]^2*(`&rho;__v`[1, 2]^2-1)-`&sigma;__&epsilon;2`^2)*`&sigma;__v`[1]^2-`&sigma;__&epsilon;1`^2*(`&sigma;__&epsilon;2`^2+`&sigma;__v`[2]^2))


See for example that they share the same denominator...
# I want Maple to automatically/smartly choose the most compact way...e.g., (i) t2=t1+... or (ii) t2=t3*... (i) is equivalent to (ii) but I want Maple to pick (ii) if more compact than (i)
# I have 9 expressions like t1,t2,t3 and I want Maple to re-write them as function of each other smartly

 

NULL

``

Download rearrangingterms.mw

It must be something similar to this https://www.mapleprimes.com/maplesoftblog/201455-Rearranging-The-expression-Of-Equations, but my case is slighty different.

Please Wait...