Bibm@th

Forum de mathématiques - Bibm@th.net

Bienvenue dans les forums du site BibM@th, des forums où on dit Bonjour (Bonsoir), Merci, S'il vous plaît...

Vous n'êtes pas identifié(e).

#1 Programmation » [SCILAB] Correction d'un script » 02-02-2021 11:29:32

chahid
Réponses : 4

qui peut m'aider à trouver les erreurs dans le script ci-dessous et mrc:

clf
//unsteady state column

//List of equations to be solved




//variable speci

//tempfin=var(4);

//Data input
plates=11;
LtoD=3;
Pend=(LtoD)/(LtoD+1);

//list of xd to solve the integral
ydest=[0.75:0.01:0.85];
yd=0.83;
xf=0.11;
Feed=350;



//polinomial
coea2=-16.78846;
coeb2=5.35043771;
coec2=0.07820301;

coea1=0.2774380;
coeb1=0.21006435;
coec1=0.4766639;
//antoine coef
Awa=18.3036;
Bwa=3816.44;
Cwa=227.02;

Aet=18.9119;
Bet=3803.98;
Cet=231.47;

//integration
for i=1:1:11
    yd=ydest(i);
    yeq(i,1)=yd;
   
    for j=1:1:plates
        if yeq(i,j)>0.5044
            then
            xeq(i,j)=(-coeb1+(coeb1^2-4*(coea1*(coec1-yeq(i,j))))^0.5)/(2*coea1);
           
        else
        xeq(i,j)=(-coeb2+(coeb2^2-4*(coea2*(coec2-yeq(i,j))))^0.5)/(2*coea2);
    end
   
        if j<11
            then
            yeq(i,j+1)=Pend*xeq(i,j)+(1-Pend)*yeq(i,1);
    end
end
xw(i)=xeq(i,11);
inv(i)= 1/(ydest(i)-xw(i))
end


// integral computation
for i=1:1:10
difer(i) =inv(i)*(xw(i+1)-xw(i));
end

coefint=polyfit(xw,inv,2);
Integral=(coefint(1)/3)*(xf.^3-xres.^3)+(coefint(2)/2)*(xf.^2- xres.^2)+(coefint(3))*(xf-xres)

function resid=rectdis(var)

    ydest=[0.75:0.01:0.85];
    yd=0.83;
    xf=0.11;
    Feed=350;
    xres=var'(1);
    Residue=var'(2);
    Distillate=var'(3);
   
   
    resid(1)=Residue*exp(Integral)-Feed;
    resid(2)=Feed-Distillate-Residue;
    resid(3)=Feed+xf-Distillate*yd-Residue*xres;
endfunction

a=fsolve([0.05,300,50],rectdis);

Pied de page des forums