I tried to solve the code in R2015a but constantly getting errors:The following error occurred converting from sym to double.DOUBLE cannot convert the input expression into a double array. If the input expression contains a symbolic variable, use VPA

1 visualización (últimos 30 días)
syms x real
%material property at the left end steel
E0=2.1*10^11
G0=0.8*10^11
rho0=7.85*10^3
%material property at right end Al
E1=0.7*10^11
G1=0.2697*10^11
rho1=2.707*10^3
Ks=0.8667%shear correction factor
%geometrical properties
L=0.5
B=0.1%Width of beam
h0=0.25
h1=0.20
A0=B*h0
I0=(B*(h0)^3)/12
alpha=(h0-h1)/h0%taper parameter
h(x)=1-(alpha*(x/L))%THICKNESS OF BEAM
A(x)=B*h(x)%area of the beam
I(x)=(B*(h(x))^3)/12%M.I of beam
%foundation properties
b=0.1
d=1
Gs=E0
K0=500
mu=2
K(x)=K0*(1-(mu*sin(x)))
%fgm law
n=2
E(x)=E0+(E1-E0)*(x/L)^n
G(x)=G0+(G1-G0)*(x/L)^n
rho(x)=rho0+(rho1-rho0)*(x/L)^n
%thermal parameter
delta=0.2
E1(x)=E(x)*(1-(delta*(1-x)))
Error showing in E1(x)=E(x)*(1-(delta*(1-x)))

Respuestas (1)

Alan Stevens
Alan Stevens el 7 de En. de 2021
How about the following:
%material property at the left end steel
E0=2.1*10^11;
G0=0.8*10^11;
rho0=7.85*10^3;
%material property at right end Al
E1=0.7*10^11;
G1=0.2697*10^11;
rho1=2.707*10^3;
Ks=0.8667;%shear correction factor
%geometrical properties
L=0.5;
B=0.1;%Width of beam
h0=0.25;
h1=0.20;
A0=B*h0;
I0=(B*(h0)^3)/12;
alpha=(h0-h1)/h0;%taper parameter
h =@(x) 1-(alpha*(x/L));%THICKNESS OF BEAM
A =@(x) B*h(x);%area of the beam
I =@(x) (B*(h(x))^3)/12;%M.I of beam
%foundation properties
b=0.1;
d=1;
Gs=E0;
K0=500;
mu=2;
K= @(x) K0*(1-(mu*sin(x)));
%fgm law
n=2;
E =@(x) E0+(E1-E0)*(x/L).^n;
G =@(x) G0+(G1-G0)*(x/L).^n;
rho =@(x) rho0+(rho1-rho0)*(x/L).^n;
%thermal parameter
delta=0.2;
E2=@(x) E(x).*(1-(delta*(1-x))); % You have E1 as a constant above
% Example plot
x = 0:L/100:L;
plot(x,E(x),x,G(x)),grid
legend('E','G')

Categorías

Más información sobre General Physics en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by