Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
%Define Variables
xr = 0;
es = 0.0001;
maxit = 300;
xl=1;%inital guess
xu=300;%initial guess
dx= 10e-6;
%Plot
N=20;
maxit = linspace(1,400,N);
ea_nr=zeros(1,N); % appr error Newton-Raphson method
ea_ms=zeros(1,N); % appr error Modified Secant method
ea_fp=zeros(1,N); % appr error false point method
ea_bs=zeros(1,N); % appr error bisect method
for i=1:length(maxit)
[root_nr,ea_nr(i),iter_nr]= newtraph(@ (theta) projectile(theta),@ (theta) dprojectile_dtheta (theta),xr,es,maxit(i)); %roots for n
[root_ms,ea_ms(i),iter_ms]=mod_secant(@ (theta) projectile(theta),dx,xr,es,maxit(i));
[root_fp,fx_fp,ea_fp(i),iter_fp]=falsepos(@ (theta) projectile(theta),xl,xu,es,maxit(i));
[root_bs,fx_bs,ea_bs(i),iter_bs]=bisect(@ (theta) projectile(theta),xl,xu,es,maxit(i));
end