I have a variable matrix sigma_xz with (x,y,z) variables and want to evaluate it for different values of (x,y) to get a new matrix with only variable (z). How can I do this?

2 views (last 30 days)
clc;clear all;close all;
tic
syms x y z
D11=2.4804; D12=0.0543; D22=0.5419; D66=0.0792; w_11=1.278;
a=0.2;b=0.1;
w(x,y)=w_11*sin(pi*x/a)*sin(pi*y/b)
kx= diff(w,x,2);
ky= diff(w,y,2);
kxy= diff(w,x,y);
k=[kx;ky;kxy];
n=4 % #of layers
Q_bar(:,:,1)=[155.7478 3.0153 0;
3.0153 12.1584 0;
0 0 4.4000]
Q_bar(:,:,2) =[12.1584 3.0153 0;
3.0153 155.7478 0;
0 0 4.4000]
Q_bar(:,:,3) =[12.1584 3.0153 0;
3.0153 155.7478 0;
0 0 4.4000]
Q_bar(:,:,4) =[155.7478 3.0153 0;
3.0153 12.1584 0;
0 0 4.4000]
digits(8) %specifying # of digits in output
for i=1:n
sigma(:,1,i)=vpa(-z*Q_bar(:,:,i),7)*k;
end
vpa(sigma(:,:,:))
for i=1:n
dsigma_xz(i)=diff(sigma(1,1,i),x)+diff(sigma(3,1,i),y);
sigma_xz(i)=int(dsigma_xz(i),z);
end
vpa(dsigma_xz(:));
vpa(sigma_xz(:));

Accepted Answer

KSSV
KSSV on 16 Oct 2018
x = pi/4 ;
sigma_xz = subs(sigma_xz,x) ;
y = pi/2 ;
sigma_xz = subs(sigma_xz,y) ;

More Answers (0)

Community Treasure Hunt

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

Start Hunting!