Simplying linear equation to get quartic in q using Maple and then using Descarte’s rule of sign

65 Views Asked by At

Using the maple I am trying to get quardic in q from this big linear equation. Then use Descarte’s rule of signs to determine the number of positive roots. \begin{equation} \frac{\gamma*q*P_Q}{k_p*(1-q)*P_C} = \frac{I*\alpha}{k_f+k_d+\frac{k_n*\lambda_b*\gamma*q*P_Q}{\lambda_b*\gamma*q*P_Q+k_p*\lambda_r*(1-q)^2}+k_p*(1-q)} \end{equation} Values of parameters are given below: $I=1200$ $k_f = 6.7*10.^7$ $k_d = 6.03*10.^8$ $k_n = 2.92*10.^9$ $k_p = 4.94*10.^9$ $\alpha = 1.14437*10.^(-3)$ $\lambda_b = 0.87e-2$ $\lambda_r = 835$ $\gamma = 2.74$ $P_C = 3*10.^(11)$ $P_Q = 2.87*10.^(10)$

=> I tried the code in maple to get quartic in q but DOES NOT SIMPLIFY IT.

II := 1200: 
k_f := 6.7*10.^7: 
k_d := 6.03*10.^8: 
k_n := 2.92*10.^9: 
k_p := 4.94*10.^9: 
alpha := 1.14437*10.^(-3): 
lambda_b := 0.87e-2:
lambda_r := 835:
ggamma := 2.74:
P_C := 3*10.^11: 
P_Q := 2.87*10.^10:

 eq := ggamma*q*P_Q/(k_p*(1-q)*P_C) = II*alpha/(k_f+k_d+k_n*lambda_b*ggamma*q*P_Q/(lambda_b*ggamma*q*P_Q+k_p*lambda_r*(1-q)^2)+k_p*(1-q)):

simply(eq, q);

My lecturer want me to manipulate the equation and get a quartic in q before substituting the values of parameters into the equation. After that,use Descarte’s rule of signs to determine the number of positive roots. Then write Q=1-q to get second quartic in Q and repeat rule of signs to determine number of steady states of q less than 1. And do the substition of parameters if necessary. Now, its kind of hard for me what he wants because to get quartic in q first from the equation is hard to do by hand , so i have to use in maple which is not working then use Descarte’s rule of signs.

1

There are 1 best solutions below

1
On BEST ANSWER

'I' and 'gamma' are special names in Maple, so I've replaced them with 'II' and 'ggamma' below.

You forgot terminators (color or semicolon) on some of your lines of code. I've added them, below. That is the cause of a parsing error.

Assignment in Maple is accomplished using ':=' not '='. The latter just forms equations, and doesn't do assignment.

You can use 'solve' or 'fsolve' to find all the real and/or real & complex answers.

restart:

II:=1200:
k_f := 6.7*10.^7:
k_d := 6.03*10.^8: 
k_n := 2.92*10.^9:
k_p := 4.94*10.^9:
alpha := 1.14437*10.^(-3):
lambda_b := 0.87e-2:
lambda_r := 835:
ggamma := 2.74:
P_C := 3*10.^11:
P_Q := 2.87*10.^10:

eq := (ggamma*q*P_Q)/(k_p*(1-q)*P_C)
       = II*alpha/(k_f+k_d+k_n*lambda_b*ggamma*q*P_Q
         /(lambda_b*ggamma*q*P_Q+k_p*lambda_r*(1-q)^2)+k_p*(1-q)):

solve(eq,q);

   0.9584636255, 5.405304886, 1.005274846 + 0.02511765461 I, 

   1.005274846 - 0.02511765461 I

You don't actually need to do all those assignments. An alternative is to evaluate the equation at those values, using a list of equations which represent the substitutions.

restart:

eq := (ggamma*q*P_Q)/(k_p*(1-q)*P_C)
       = II*alpha/(k_f+k_d+k_n*lambda_b*ggamma*q*P_Q
         /(lambda_b*ggamma*q*P_Q+k_p*lambda_r*(1-q)^2)+k_p*(1-q)):

vals := [II=1200, k_f = 6.7*10.^7, k_d = 6.03*10.^8, 
         k_n = 2.92*10.^9, k_p = 4.94*10.^9, alpha = 1.14437*10.^(-3),
         lambda_b = 0.87e-2, lambda_r = 835, ggamma = 2.74,
         P_C = 3*10.^11, P_Q = 2.87*10.^10]:

solve(eval(eq,vals),q);

     0.9584636255, 5.405304886, 1.005274846 + 0.02511765461 I, 

     1.005274846 - 0.02511765461 I

It may be worth noting that those four roots may be all the zeros, considering that the numerator of the following is a quartic in 'q'.

normal(eval((lhs-rhs)(eq),vals));