Ronan

1506 Reputation

16 Badges

14 years, 224 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are answers submitted by Ronan

These 2 equations can be solved using the Sylvester Maxtrx technique. Have annotated the worhsheet to try and explain.

Would be interesting to see other techniques for solving them.
 

restart

with(LinearAlgebra)

 

eq1 := (1/4)*p*g*A*B+(1/2)*g^2*A*B*h-(7/12)*p*g*A*h+(5/6)*A^2*h^2+(13/12)*A^2*h-(1/3)*p*A^2+(5/12)*g*A-(3/2)*g^2*A-(1/4)*p*A^2*h*c*g^2+(1/4)*p*g*A*d*h-(1/12)*p*g^2+(3/2)*A^3*h^3+(1/4)*p*A^2*h^2*d+(1/4)*p*A^2*h^2*B+(1/4)*p*A^2*h*B+(1/4)*A^2*h*c*g^2-(1/4)*p*A*c*g^3-(1/4)*g*A*B*h+(1/4)*g*A*d*h+(1/3)*A^2-(13/12)*p*A^2*h+(1/4)*p*g*A*B*h-(5/12)*p*g*A-(1/4)*g*A*B-(1/2)*g^2*A*B+(1/4)*A*c*g^3-(5/6)*p*A^2*h^2+(7/12)*g*A*h-(1/4)*A^2*h^2*d-(1/4)*A^2*h*B+(1/2)*g^2*A*B+(1/12)*g^2+(1/2)*g*A^2*h^2-(1/2)*g^4*A*c-2*g*A^2*h+(1/2)*A*d*h-(1/4)*A^2*h^2*B

NULL

NULL

eq2 := -(5/6)*A*c*g*h^3*B*d-4*h^3*c*g*A-(11/3)*c^2*g^4*h-9*A*c*g*h^2+7*h*B*c*g^2-6*A*c*g*h+(10/3)*c^2*g^4*h*B+(1/6)*h^2*B^4-(10/3)*c^2*g^3*h^2*A+(7/6)*B^2*h^3*d+3*B*c*g^2-A*c*g-2*h^2*c*g^2-(7/6)*d^2*h+(7/3)*B^2*h^3*d+(29/12)*d^2*h^3*B-h^4*c*A^2-c*A^2*h^2-B*h^3*d+(3/2)*c*d*g^2-B^2*c*g^2-3*d*h*B-3*d*h^2*B+(1/6)*B^3*h^2*d+(7/6)*d*B^2*h+(29/12)*d^2*h^2*B-4*h*c*g^2-(5/6)*B^2*h^3*A*c*g-(1/6)*B^2*c*g^2*d*h^2-(5/6)*B^2*h^2*A*c*g+(5/6)*B*c^2*g^3*A*h^2-(23/4)*d*h^2*B*c*g^2+(14/3)*d*h^3*A*c*g-(59/12)*d*h*B*c*g^2+(19/6)*d*h^2*A*c*g+(7/2)*B*A*c*g*h+(17/2)*B*A*c*g*h^2+5*B*h^3*A*c*g+(1/12)*B^4*h+(5/4)*d^3*h^3-(3/2)*c^3*g^6+(1/12)*h^3*B^4-(7/6)*h^3*d^2-(7/3)*d^2*h^2-B*d-2*c*g^2-4*c^2*g^4+(1/2)*d*h^4*c*A^2+(1/2)*B*h^4*c*A^2+(1/2)*B*h^3*c*A^2+(5/6)*A^2*c^2*g^2*h^3-(1/6)*B^3*c*g^2*h^2+(1/12)*h*c^2*g^4*B^2-(1/6)*B^3*c*g^2*h+(17/4)*d*h*c^2*g^4-4*d^2*h^2*c*g^2+(31/6)*d*h^2*c*g^2-(9/2)*c^2*g^3*A*h+(17/3)*d*h*c*g^2+4*B*h^2*c*g^2-(17/6)*h*B^2*c*g^2-(11/6)*B^2*h^2*c*g^2+(5/2)*c^2*g^4*B+(1/12)*d^2*h^3*B^2+(1/6)*B^3*h^3*d-2*c*A^2*h^3

NULL

NULL

Sylvesterg := SylvesterMatrix(eq1, eq2, h);

PolySylg := sort(LinearAlgebra:-Determinant(Sylvesterg), g);

``

Alternatively a Polynomial in h can be made

 

NULL

You need Numerical values for A,B,c,d,p to solve the polynomial

Then back substitute the roots into one of the equations to get the corresponding values of g or h.

 

Test Values

A := 3/2; 1; B := 6/5; 1; c := 9/7; 1; d := 4/3; -1; p := 1/2

Digits := 20;

sort(PolySylg, g)

G := [fsolve(PolySylg, g)];

NULL

Back Substitution

NULL

for i to nops(G) do g := G[i]; H1[i] := fsolve(eq1, h) end do

 

for i to nops(G) do g := G[i]; H2[i] := fsolve(eq2, h) end do

NULL


Download 2_non-linear_equatio.mw

I would suggest you contact your supplier. I purchased a home use license of maple 15 early march and got a free upgrade to maple 16 when it was released. I just purchesed the home user license for maple 16 last week. I suppose by the time maple 17 and sim 7 are released I will need to pay something to get an upgrade.

Thank you all for replys and comments. I did get assign to work. there was a duplicate entry ie 2 rows the same which caused the problem. To clarify a some of the ponts raised. The rows are dependant on the previous rows. I choose a matrix because in a previous post Iwas told lists can be inefficant. Also athe matrix is visually easy to read I find. What I posed was just a short made up example. Thr algsubs on the equations is to shorten them as the can go on for screenful after screenfull. At the end of the assembling the equations I end uo with a 4x4 matrix whose determinant multiplies out to a 20th order polynomial. It is at this point I am using the assign to the valuse saved in the store matrix. I shall experiment with the

"#If you prefer assignment then you can use the two elementwise operations assign~ and  =~  : assign~(store[..,1]=~store[..,2]): a1,CX3,S1; "

At present I am using a for i to 100 do loop.

First 7 8 9 Page 9 of 9