amba

5 Reputation

One Badge

5 years, 12 days

MaplePrimes Activity


These are questions asked by amba

Hi all,

I am new here, and it's my first post :)

I am a second year chemical engineering student, I have a homework with use of MAPLE software. Here is my code:

> L := [seq(i, i = 0.1e-1 .. 2500, 1)];
> v := Vector(L);
> Tc := 190.6;
> Pc := 46.1;
> w := 0.12e-1;
> R := 83.14;
> b := 0.8664e-1*R*Tc/Pc;
> m := .48+1.574*w-.175*w^2;
> n := length(v);
> P := Matrix(n, 10):

> MaProcedure := proc (x, i)
global P;
y := x;
for j to n do
P[j, i] := R*T/(y-b)+(-1)*a/(y*y*b)
end do
end proc;

> for i to 10 do
T := 99+10*i;
Tr := T/Tc;
a := .42748*R*Tc*(1+(1-sqrt(Tr)))^2/Pc;
for j to 26 do
MaProcedure(v[j], i)
end do
end do;

As you may deduce, P is the pressure, T the temperature and v is the molar volume.

I choosed to consider P as a matrix of n x 10 elements. and I desire to plot P in terms of v for 10 different temperatures.. every column of P contains the values of P computed for each v at a specified temprature T.

Hence, I must get 10 curves for P in one figure. But I guess that this code doesn't work. Can you help please? I don't mind if you have others suggestions for solving this problem.

PS: I want to obtain curves like shown in the figure below.

Thanks in advance :)

Page 1 of 1