
M=read("tungstene_0.txt",-1,2);
i=M(:,1);
v=M(:,2);
[n1,n2]=size(i);
                
figCaracteristique=scf();

plot2d(i,v,style=-5);
xgrid(color("grey"));
xtitle("","i(A)","v(V)");
                

Re=i;
Pe=i;
for k=1:n1, Re(k)=v(k)/i(k); Pe(k)=v(k)*i(k); end;
                
figResistance=scf();

plot2d(Pe,Re,style=-5);
xgrid(color("grey"));
xtitle("","Pe(W)","Re(Ohm)");
                
 
a=2.5e-14;
b=2.3e-10;
T=2700; R=6;  x=R/(a*T^2+b*T);
function T=temperature(R)
    rho = R/x
    delta=b^2+4*a*rho
    T=(-b+sqrt(delta))/(2*a)
endfunction
Tf=Re;
for k=1:n1, Tf(k)=temperature(Re(k));, end;
function T=f(P)
    T=Tf(n1)*(P/Pe(n1))^0.25
endfunction
                
figTemperature=scf();

plot2d(Pe,Tf,style=-5,logflag="ll",rect=[0.1,1e3,1e2,1e4]);
fplot2d(Pe,f,style=5)
xgrid(color("grey"));
xtitle("","Pe (W)","T (K)");
                
