Crossley Mjojo

5 Reputation

One Badge

4 years, 225 days

MaplePrimes Activity


These are replies submitted by

Unfortunately, the fsolve app can give solutions for certain values of rho and not for others for the same equation G(s) = 0.  The latter is a simplified version of the original function F.  Also, it is failing to give all solutions if there are several for the same T.  Please kindly assist me in editing the following procedure for finding the solutions via iteration. 

In this procedure, I begin by assigning an initial value of s, and proceed to do the iteration until the function G(s) = 0 for a fixed value of T.  When this condition is achieved I want to collect values of s for ten values of T > 0, rho < 1/2.

I am new to Maple.  The procedure is not working.

s := 0.995;

procname := proc(s)

local R, A, B, rho, T;

R := 8.314;

A := 3.511*R;

B := 4.389*R;

T := 1.0;

s := s - 0.005;

rho := (T/3.135)^(3/2);

G(s) := R*T*rho*ln((s + 1)*(1 - rho*(1 - s))/((1 - s)*(1 - rho*(s + 1)))) - 4*s*rho*(1 - rho)*((1 - rho)*A + rho*B);

if eval(G(s)) < 1/100000 then

return s;

else thisproc(s);

end if;

end proc;
 

 

@Carl Love 

Thank you very much!  Can't thank you enough.

Best wishes,

 

Crossley

@Carl Love   

Thank you for the interest and willingness to assist.  I have corrected the errors.  This browser inserts * in the space between ln and argument.  I have removed the space.  I have resubmitted the equation with the corrections.

Thank you very much!

Crossley

In the problem below I am looking for solutions for s where  0<= s<=1 to the equation for a given temperature T with everything else held constant.  For example, please find values of s for five different values of T such that 0 <=rho<1/2.  I will do the rest once I am given the procedure.

x := 0;

R := 8.3145;
mu := 29.1921
nu := 36.4922
T := 1.0;
 
rho := (T/3.135)^(3/2);

 

F:=(1-x)* R*((1)/(2)*((1-rho*(1-s))* ln(1-rho*(1-s))+ rho*(1-s)*ln(rho*(1-s))+(1-rho*(1 + s)) ln(1-rho*(1+ s))+ rho*(1+ s)*lnrho*(1+ s))))+(1-x)*(R*T)/(2)*((1-s) ln((1-rho*(1-s))*rho*(1-s))+(1+ s)*ln(rho*(1+ s)*(1-rho*(1+ s)))+(1-x)*(1-s^(2))*(( 1-4*rho+3*rho^(2)  )*mu+( 2*rho- 3* rho^(2))*nu))*(0.1801539058 T^(3/2))+((1-x)*R*T*rho ln(((1+ s)*(1-rho*(1-s)))/((1-s)*(1-rho*(1+ s))))-(2* s* rho*(1-rho)*(1-x)*((1-rho)*mu+rho*nu)))* ((-(1-x)* (R*T)/(2)*((1-s) ln((1-rho*(1-s))*rho(1-s))+(1+ s) ln((rho*(1+ s)*(1-rho*(1+ s)))+(1-x)*(1-s^(2))*(( 1-4 rho+3 rho^(2)  )*mu+( 2 rho- 3 rho^(2))*nu))*(0.1801539058 T^(3/2))-(1-x)* R*((1)/(2)*((1-rho*(1-s))*ln(1-rho*(1-s))+ rho*(1-s)*ln(rho*(1-s))+(1-rho*(1 + s)) ln(1-rho*(1+ s))+ rho*(1+ s) ln (rho*(1+ s))))))/(((1-x)*(R^*T)/(2) rho ln(((1+ s)*(1-rho*(1-s)))/((1-s)*(1-rho*(1+ s))))-(2 *s* rho*(1-rho)*(1-x)*((1-rho)*mu+rho*nu)))));

x := 0;
                             x := 0

R := 8.314472;
                         R := 8.314472


mu := 3.511*R;
                       mu := 29.19211119

nu := 4.389*R;
                       nu := 36.49221761


T := 1.0;
                            T := 1.0

 

rho := (T/3.135)^(3/2);
                      rho := 0.1801539058


s := 0.9;


F := (1 - x)*R*1/2*((1 - rho*(1 - s))*ln*(1 - rho*(1 - s)) + rho*(1 - s)*ln*rho*(1 - s) + (1 - rho*(1 + s))*ln*(1 - rho*(1 + s)) + rho*(1 + s)*ln*rho*(1 + s)) + 0.1801539058*(1 - x)*R*T/2*((1 - s)*ln*(1 - rho*(1 - s))*rho*(1 - s) + (1 + s)*ln*rho*(1 + s)*(1 - rho*(1 + s)) + (1 - x)*(-s^2 + 1)*((3*rho^2 - 4*rho + 1)*mu + (-3*rho^2 + 2*rho)*nu))*T^(3/2) - ((1 - x)*R*T*rho*ln*(1 + s)*(1 - rho*(1 - s))/((1 - s)*(1 - rho*(1 + s))) - 2*s*rho*(1 - rho)*(1 - x)*((1 - rho)*mu + rho*nu))*(1 - x)*R*T/2*((1 - s)*ln*(1 - rho*(1 - s))*rho(1 - s) + 0.1801539058*(1 + s)*ln*(rho*(1 + s)*(1 - rho*(1 + s)) + (1 - x)*(-s^2 + 1)*((3*rho^2 - 4*rho + 1)*mu + (-3*rho^2 + 2*rho)*nu))*T^(3/2) - (1 - x)*R*1/2*((1 - rho*(1 - s))*ln*(1 - rho*(1 - s)) + rho*(1 - s)*ln*rho*(1 - s) + (1 - rho*(1 + s))*ln*(1 - rho*(1 + s)) + rho*(1 + s)*ln*rho*(1 + s)))/((1 - x)*R*T/2*rho*ln*(1 + s)*(1 - rho*(1 - s))/((1 - s)*(1 - rho*(1 + s))) - 2*s*rho*(1 - rho)*(1 - x)*((1 - rho)*mu + rho*nu));

  1. x, r, s, T are variables.  T = temperature, > 0 K;  x = composition variable 0<or =x< or =1; r is a fraction 0<or =r< or =1; s is a degree of order such that 0<or =s< or =1
  2. The function F is already a derivative; dG/dT = 0
  3. The problem is to find numerical values of s that satisfy this condition for each temperature T.
Page 1 of 1