Answered step by step
Verified Expert Solution
Question
1 Approved Answer
how can I rewire these codes in a different way. % boundary conditions and point forces for i = 1:size(node,1) if node(i,2)^2+node(i,3)^2 < 4.01^2 flags(node(i,1))
how can I rewire these codes in a different way.
% boundary conditions and point forces
for i = 1:size(node,1)
if node(i,2)^2+node(i,3)^2 < 4.01^2
flags(node(i,1)) = 2; % flag nbc as 2
e_bc = [e_bc; node(i,1)];
e_bc(i) = 20;
end
end
%coords of essential B.C.
nd = size(e_bc,1); % number of nodes on essential boundary
% nd = 9; % number of nodes on essential boundary
%
% % essential B.C.
% flags(1:5) = 2; e_bc(1:5) = 0.0;
% flags(6:5:21) = 2; e_bc(6:5:21) = 0.0;
% plots
compute_flux = 'yes';
plot_mesh = 'yes';
plot_nod = 'yes';
plot_temp = 'yes';
plot_flux = 'yes';
% natural B.C - defined on edges positioned on natural boundary
% essential B.C.
n_bc = [];
for i = 1:size(node,1)
if node(i,2)^2+node(i,3)^2 > 4.199^2 && node(i,3)>0
a=(-1380)*sin(atan(node(i,3)/node(i,2)));
n_bc = [n_bc; [i,a]];
end
end
n_bc_d = sortrows(n_bc,2);
% arrange element in descending order based on q
n_bc = [];
for i = 1:size(n_bc_d,1)-1
b=[n_bc_d(i,1);n_bc_d(i+1,1);n_bc_d(i,2);n_bc_d(i+1,2)];
n_bc = [n_bc,b];
end
n_bc ;
nbe = size(n_bc,2); % natural B.C.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started