Question
Can you please improve my Matlab code(The secant method) such that i can solve every Bl given that theta is an interval from 0:0.1:42 %Code%
Can you please improve my Matlab code(The secant method) such that i can solve every Bl given that theta is an interval from 0:0.1:42
%Code%
clear all
clc
M2=5;
r=1.4;
theta=20;
n=length(theta)
ciL=35;
cim1L=34;
fi=((2*cotd(ciL).*((M2.^2).*((sind(ciL)).^2)-1))./((M2.^2).*(r+cosd(2*ciL))+2))-tand(theta);
while abs(fi)>1.0e-3
for i=1:n
fi(i)=((2*cotd(ciL).*((M2.^2).*((sind(ciL)).^2)-1))./((M2.^2).*(r+cosd(2*ciL))+2))-tand(theta);
fim1=((2*cotd(cim1L).*((M2.^2).*((sind(cim1L)).^2)-1))./((M2.^2).*(r+cosd(2*cim1L))+2))-tand(theta);
cip1L=ciL-(ciL-cim1L)*fi/(fi-fim1);
cim1L=ciL;
ciL=cip1L;
end
end
BL=cip1L
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