Ronan

1396 Reputation

16 Badges

13 years, 352 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are replies submitted by Ronan

Some procress on my problem. I found a proc somebody here wrote for me.  I searched but can't find the question now to credit the author. 
I have manually applied the concept to pairs of elements list wise as a test I haven't figured out how to get frontend working with multiple gcd's.

This could be applied to longer lists/vectors or even matrices.
I have just tested on one vector and it produced about a 30% reduction. I  would like to get this into an efficient procedure.
 


 

restart

#Fact written be a MaplePrimes member around 2017/18

fact := (expr::equation) -> frontend(gcd, [numer(lhs(expr)), numer(rhs(expr))])/frontend(gcd, [denom(lhs(expr)), denom(rhs(expr))])

proc (expr::equation) options operator, arrow; frontend(gcd, [numer(lhs(expr)), numer(rhs(expr))])/frontend(gcd, [denom(lhs(expr)), denom(rhs(expr))]) end proc

(1)

eq := (F + G)*R*sinh(x)/sqrt(W - 1) = 1/2*M*R^2*tan(x)*a/(R*sqrt(W - 1))

(F+G)*R*sinh(x)/(W-1)^(1/2) = (1/2)*M*R*tan(x)*a/(W-1)^(1/2)

(2)

fact(eq)

R/(W-1)^(1/2)

(3)

eq/fact(eq)

(F+G)*sinh(x) = (1/2)*M*tan(x)*a

(4)

#Concept applied to a list of 2 elements

fact1 := (expr::list) -> frontend(gcd, [numer((expr[1])), numer((expr[2]))])/frontend(gcd, [denom((expr[1])), denom((expr[2]))])

proc (expr::list) options operator, arrow; frontend(gcd, [numer(expr[1]), numer(expr[2])])/frontend(gcd, [denom(expr[1]), denom(expr[2])]) end proc

(5)

 

 

 

l3:=Vector[column](3, [2*(((a^3 + a*b^2)*sqrt(b^2 + c^2) + 1/2*b^4 + 1/2*b^2*c^2 + 1/2*c^2*f^2 + 1/2*f^4)*sqrt(a^2 + b^2) + (-1/2*a^2*b^2 - 1/2*a^2*f^2 - 1/2*b^4 - 1/2*f^4)*sqrt(b^2 + c^2) - c*(b^2 + c^2)*(a^2 + b^2))/(sqrt(b^2 + c^2)*((-b^2 + f^2)*sqrt(a^2 + b^2) + (b^2 - f^2)*sqrt(b^2 + c^2) + (2*a^2 + 2*b^2)*(a - c))) - (-sqrt(a^2 + b^2)*sqrt(b^2 + c^2) + f^2)/sqrt(b^2 + c^2), -(2*sqrt(b^2 + c^2)*(-1/2*b^2*c + f^2*(a - 1/2*c))*sqrt(a^2 + b^2) + (b - f)*(b + f)*(a*f^2 + b^2*c + c^3 - c*f^2))/(sqrt(b^2 + c^2)*((-b^2 + f^2)*sqrt(a^2 + b^2) + (b^2 - f^2)*sqrt(b^2 + c^2) + (2*a^2 + 2*b^2)*(a - c))) + b^2/sqrt(a^2 + b^2), (2*sqrt(b^2 + c^2)*(-1/2*b^2*c + f^2*(a - 1/2*c))*sqrt(a^2 + b^2) + (b - f)*(b + f)*(a*f^2 + b^2*c + c^3 - c*f^2))*(-sqrt(a^2 + b^2)*sqrt(b^2 + c^2) + f^2)/((b^2 + c^2)*((-b^2 + f^2)*sqrt(a^2 + b^2) + (b^2 - f^2)*sqrt(b^2 + c^2) + (2*a^2 + 2*b^2)*(a - c))) - (2*((a^3 + a*b^2)*sqrt(b^2 + c^2) + 1/2*b^4 + 1/2*b^2*c^2 + 1/2*c^2*f^2 + 1/2*f^4)*sqrt(a^2 + b^2) + 2*(-1/2*a^2*b^2 - 1/2*a^2*f^2 - 1/2*b^4 - 1/2*f^4)*sqrt(b^2 + c^2) - 2*c*(b^2 + c^2)*(a^2 + b^2))*b^2/(sqrt(b^2 + c^2)*((-b^2 + f^2)*sqrt(a^2 + b^2) + (b^2 - f^2)*sqrt(b^2 + c^2) + (2*a^2 + 2*b^2)*(a - c))*sqrt(a^2 + b^2))])

Vector(3, {(1) = (2*((a^3+a*b^2)*sqrt(b^2+c^2)+(1/2)*b^4+(1/2)*b^2*c^2+(1/2)*c^2*f^2+(1/2)*f^4)*sqrt(a^2+b^2)+2*(-(1/2)*a^2*b^2-(1/2)*a^2*f^2-(1/2)*b^4-(1/2)*f^4)*sqrt(b^2+c^2)-2*c*(b^2+c^2)*(a^2+b^2))/(sqrt(b^2+c^2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2)*b^2+(a^2+b^2)^(1/2)*f^2+2*a^3-2*a^2*c+2*a*b^2-2*b^2*c))

(8)

 

simplify(l3/f23)

Vector(3, {(1) = ((4*a-2*c)*(a^2+b^2)*sqrt(b^2+c^2)+2*b^4+2*b^2*c^2)*sqrt(a^2+b^2)-(2*a^2+2*b^2)*(a*f^2+b^2*c+b^2*sqrt(b^2+c^2)+c^3-c*f^2), (2) = (2*b-2*f)*(b+f)*((-(1/2)*sqrt(a^2+b^2)*b^2+(a-(1/2)*c)*(a^2+b^2))*sqrt(b^2+c^2)+(-(1/2)*b^2*c+(1/2)*(-a+c)*f^2-(1/2)*c^3)*sqrt(a^2+b^2)+(1/2)*b^4+(1/2)*b^2*c^2)/sqrt(a^2+b^2), (3) = -((((2*a-c)*b^6+(2*a*c^2-c^3+(-a^2-2*f^2)*c+2*a^3+2*a*f^2)*b^4+((-a^2-2*f^2)*c^3+(2*a^3+2*a*f^2)*c^2+(-a^2*f^2+2*f^4)*c+2*a^3*f^2-a*f^4)*b^2+(-a^2*f^2+f^4)*c^3+2*a^3*c^2*f^2-c*f^6+a*f^6)*sqrt(a^2+b^2)-b^2*(b^2+c^2)*(a^2*b^2+a^2*f^2+b^4+f^4))*sqrt(b^2+c^2)+(b^2+c^2)*(b^2*(b^4+b^2*c^2+c^2*f^2+f^4)*sqrt(a^2+b^2)+(-b^4*c+(a*f^2-c^3-c*f^2)*b^2-3*a*f^4-c^3*f^2+2*c*f^4)*(a^2+b^2)))/(sqrt(a^2+b^2)*(b^2+c^2))})

(9)

length(%)

1232

(10)

length(l3)

1812

(11)

length(simplify(l3))

1700

(12)

 


 

Download 2024-05-10_Q_Progress_on_Rescale_projective_vector.mw

@acer Yes. I shali experiment more on this

@Carl Love I never knew that the ab=ba could be done 

(ab, bc, cd, da):= ((ba, cb, dc, ad):= (17, 17, 29, 18))

also `&D;` I guess because D is the derivative operator.

@acer Thank you. I will test that tonight.

@mmcdara I dont think that actualy works. I  tried something similar without LargeExpressions and managed to totally seperate the real and imaginary. But got the wrong answer. Nice try though.

@Kitonum Ah,I had triwd that. I didn't realise how csgn actualy works.Stuck in some values a got a correct result.

@Scot Gould   there is a   "    in the blanks to indicate what is above is repeated.

 

I has that a lot on Maple 2023. It dissappeared after I did a  reinstall of windows for months. It started again late Feb early march Just before I moved to 2024. Was having some problems initally with 2024, but not icons dissapearing though. It turned out I had installed on java viewer in late February. I removed all the java on my pc and the problem cleaned up.

@Scot Gould Sometimes it takes a quite a while to show in active conversations. I was actually going to delete the question.

There have been about two occasions where it nothing updated in active conversations over 4 or 5 months. 

@acer Thank you. I can set the results to be an Array or list.

@Scot Gould That shows the sorting very well. I converted you reply to an asnwer.

@dharr  Hi I think you just re-uploaded @Scot Gould 's worksheet.

@nm Ok, so it not a bug but pretty undependable IMO. How do I sort based on index of min value?

@nm I get the crase on Maple 2024 but not Maple 2023.2

@dharr  Not that I know off. But where should I check for the file. Could be something old in there. I am using the VS code editor and that can launch cmaple. 

First 7 8 9 10 11 12 13 Last Page 9 of 33