[Scilab-users] Scilab warning (5.5.2) vector ^ scalar
Lester Anderson
arctica1963 at gmail.com
Mon Jan 25 15:20:24 CET 2016
Hello,
I have a quick query realted to the change from 5.4.1 to 5.5.2 (and
6), related to a vector^scalar operation. The basic code runs and
plots the curves as needed but generates warnings on running:
clear()
clc()
functions_library = lib('C:\geophys\Lester\SCILAB_work\Functions');
//Finds the external function
//Flexural response function
//Universal constants
g = 9.81; //Gravitational acceleration
v = 0.25; //Poisson's ratio
E = 1e11; //Elastic modulus
G = 6.67e-11; //Gravitational constant
a = 3.28e-5; //Volumetric coefficient of thermal expansion
!
at line 15 of function flexresponsefn called by :
responsefn(Te(i),Xint,npts,rho_m,rho_c); //This version calls an e
line 30 of exec file called by :
re\flexural_response_function.sce', -1
Warning: Syntax "vector ^ scalar" is obsolete. It will be removed in Scilab 6.0.
Use "vector .^ scalar" instead.
!
at line 119 of function flexresponsefn called by :
responsefn(Te(i),Xint,npts,rho_m,rho_c); //This version calls an e
line 30 of exec file called by :
re\flexural_response_function.sce', -1
Warning: Syntax "vector ^ scalar" is obsolete. It will be removed in Scilab 6.0.
Use "vector .^ scalar" instead.
kappa = 0.8e-6; //Thermal conductivity
npts=512;
//Define parameters
Te = 0:2000:30000; //Elastic thickness [km]
rho_sed = 2400;
rho_w = 1030;
rho_m = 3330;
rho_c = 2800;
rho_infill = rho_c;
k=linspace(1,npts,(npts));
XKint = 1e-6;
Xint = 2*%pi/(XKint*(npts-1));
wavek=XKint*k*1000;
D = E*Te .^3/(12*(1-v .^2)); //Flexural rigidity
for i=1:length(Te)
phik(i,:) = flexresponsefn(Te(i),Xint,npts,rho_m,rho_c);
//This version calls an external function
end
scf(0)
clf(0)
xlabel("Log Wavenumber k km-1");
ylabel("Flexural Response Function Phi(k)");
set(gca(),"auto_clear","off")
set(gca(),"grid",[0,0])
a=gca();
a.x_location="bottom";
a.axes_reverse=["off","off","off"];
xset("colormap",[jetcolormap(16)]);
plot2d1("oln",wavek,phik');
legends("Te = "+ string(0:2:30),1:16,"ll");
External function defined as:
function phik = flexresponsefn(Te,Xint,npts,rho1,rho2)
//Flexural response function
//Isostasy and Flexure of the Lithosphere (Watts, 2000)
//Universal constants
g = 9.81; //Gravitational acceleration
v = 0.25; //Poisson's ratio
E = 1e11; //Elastic modulus
//Assumptions/calculations
XKint = 2*%pi/((npts-1).*Xint);
k=linspace(1,npts,(npts));
D = E*Te .^3/(12*(1-v .^2)); //Flexural rigidity
phik = (D.*((k-1)*XKint) .^4 /(g*(rho1-rho2))+1) .^-1; //Flexural
response function
endfunction
Now, I have changed the powers in the external function and the main
code but it still throws up warnings, I cannot see where it is falling
over especially when the warnings reference line numbers beyond those
of the function!
Thanks
More information about the users
mailing list