SlideShare une entreprise Scribd logo
1  sur  8
ANDRES FELIPE RENTERIA MARTINEZ                              2303517

CODIGO DEL PROGRAMA SCILAB

1.) Punto de biseccion



function y=f(x)

y=-12.4+10*(0.5*%pi-asin(x/1)-x*(1-x**2)**0.5);

endfunction




function xr=biseccion(xai,xbi,tol)

i=1;

ea(1)=100;

if f(xai)*f(xbi) < 0

xa(1)=xai;

xb(1)=xbi;

xr(1)=(xa(1)+xb(1))/2;

printf('It.tt Xatt Xbtt Xrtt f(Xr)t Error n');

printf('%2d t %11.7f t %11.7f t %11.7f t %11.7f n',i,xa(i),xb(i),xr(i),f(xr(i)));

while abs(ea(i)) >= tol

if f(xa(i))*f(xr(i))< 0

xa(i+1)=xa(i);

xb(i+1)=xr(i);

end

if f(xa(i))*f(xr(i))> 0

xa(i+1)=xr(i);

xb(i+1)=xb(i);
end

xr(i+1)=(xa(i+1)+xb(i+1))/2;

ea(i+1)=abs((xr(i+1)-xr(i))/(xr(i+1)));

printf('%2d t %11.7f t %11.7f t %11.7f t %11.7f t %7.6f
n',i+1,xa(i+1),xb(i+1),xr(i+1),f(xr(i+1)),ea(i+1));

i=i+1;

end

else

printf('No existe una raíz en ese intervalo');

end

endfunction



2.)punto de Newton-Rapson



function y=f(x)

y=2*x**3+x-1;

endfunction



function y=df(x)

y=6*x**2+1;

endfunction



function x=newtonraphson(x0,tol);

i=1;

ea(1)=100;

x(1)=x0;
while abs(ea(i))>=tol;

x(i+1)=x(i)-f(x(i))/df(x(i));

ea(i+1)=abs((x(i+1)-x(i))/x(i+1));

i=i+1;

end

printf(' i t X(i) Error aprox (i) n');

for j=1:i;

printf('%2d t %11.7f t %7.6f n',j-1,x(j),ea(j));

end

endfunction

3.) Punto de Interacion del punto fijo



function y=g(x)

y=300-80.425*x+201.0625*(1-exp(-(0.1)*x/0.25));

endfunction



function x=puntofijo(x0,tol)

i=1;

ea(1)=100;

x(1)=x0;

while abs(ea(i))>=tol,

x(i+1) = g(x(i));

ea(i+1) = abs((x(i+1)-x(i))/x(i+1));

i=i+1;

end

printf(' i t X(i) Error aprox (i) n');
for j=1:i;

printf('%2d t %11.7f t %7.3f n',j-1,x(j),ea(j));

end

endfunction



4.)

A)Newton

function y=f(x)

y=4*cos(x)-exp(x);

endfunction



function y=df(x)

y=-4*sin(x)-exp(x);

endfunction



function x=newtonraphson(x0,tol);

i=1;

ea(1)=100;

x(1)=x0;

while abs(ea(i))>=tol;

x(i+1)=x(i)-f(x(i))/df(x(i));

ea(i+1)=abs((x(i+1)-x(i))/x(i+1));

i=i+1;

end

printf(' i t X(i) Error aprox (i) n');

for j=1:i;
printf('%2d t %11.7f t %7.6f n',j-1,x(j),ea(j));

end

endfunction



B) Metodo de la Secante

function y=f(x)

y=4*cos(x)-exp(x);

endfunction



function x = secante(x0,x1,tol)

j=2;

i=1;

x(1)=x0;

x(2)=x1;

ea(i)=100;

while abs(ea(i))>=tol

x(j+1)=(x(j-1)*f(x(j))-x(j)*f(x(j-1)))/(f(x(j))-f(x(j-1)));

ea(i+1)=abs((x(j+1)-x(j))/x(j+1));

j=j+1;

i=i+1;

end



printf(' i tt x(i) t Error aprox (i) n');

printf('%2d t %11.7f t n',0,x(1));



for k=2:j;
printf('%2d t %11.7f t %7.3f n',k-1,x(k),ea(k-1));

end



endfunction

5.)

A) Metodo de la secante

function y=f(x)

y=x**2-6;

endfunction



function x = secante(x0,x1,tol)

j=2;

i=1;

x(1)=x0;

x(2)=x1;

ea(i)=100;

while abs(ea(i))>=tol

x(j+1)=(x(j-1)*f(x(j))-x(j)*f(x(j-1)))/(f(x(j))-f(x(j-1)));

ea(i+1)=abs((x(j+1)-x(j))/x(j+1));

j=j+1;

i=i+1;

end



printf(' i tt x(i) t Error aprox (i) n');

printf('%2d t %11.7f t n',0,x(1));
for k=2:j;

printf('%2d t %11.7f t %7.3f n',k-1,x(k),ea(k-1));

end



endfunction




5.)

B)Falsa Posicion

function y=f(x)

y=x**2-6;

endfunction




function xr=reglafalsa(xai,xbi,tol)

i=1;

ea(1)=100;

if f(xai)*f(xbi) < 0

xa(1)=xai;

xb(1)=xbi;

xr(1)=xa(1)-f(xa(1))*(xb(1)-xa(1))/(f(xb(1))-f(xa(1)));

printf('It. Xa Xb Xr f(Xr) Error aprox %n');

printf('%2d t %11.7f t %11.7f t %11.7ft %11.7f n',i,xa(i),xb(i),xr(i),f(xr(i)));

while abs(ea(i))>=tol,

if f(xa(i))*f(xr(i))< 0

xa(i+1)=xa(i);
xb(i+1)=xr(i);

end

if f(xa(i))*f(xr(i))> 0

xa(1)=xr(i);

xb(1)=xb(i);

end

xr(i+1)=xa(i+1)-f(xa(i+1))*(xb(i+1)-xa(i+1))/(f(xb(i+1))-f(xa(i+1)));

ea(i+1)=abs((xr(i+1)-xr(i))/(xr(i+1)));

printf('%2d t %11.7f t %11.7f t %11.7f t %11.7ft %7.3f n',
i+1,xa(i+1),xb(i+1),xr(i+1),f(xr(i+1)),ea(i+1));

i=i+1;

end

else

printf('No existe una raíz en ese intervalo');

end

endfunction

Contenu connexe

Tendances (20)

Cuarto Punto Parte B
Cuarto Punto Parte BCuarto Punto Parte B
Cuarto Punto Parte B
 
Quinto Punto Parte A
Quinto Punto Parte AQuinto Punto Parte A
Quinto Punto Parte A
 
week-15x
week-15xweek-15x
week-15x
 
Tercer Punto
Tercer PuntoTercer Punto
Tercer Punto
 
week-16x
week-16xweek-16x
week-16x
 
โปรแกรมย่อยและฟังชันก์มาตรฐาน
โปรแกรมย่อยและฟังชันก์มาตรฐานโปรแกรมย่อยและฟังชันก์มาตรฐาน
โปรแกรมย่อยและฟังชันก์มาตรฐาน
 
Tu1
Tu1Tu1
Tu1
 
BCSL 058 solved assignment
BCSL 058 solved assignmentBCSL 058 solved assignment
BCSL 058 solved assignment
 
Blocks+gcd入門
Blocks+gcd入門Blocks+gcd入門
Blocks+gcd入門
 
Stack using Linked List
Stack using Linked ListStack using Linked List
Stack using Linked List
 
Intro to c programming
Intro to c programmingIntro to c programming
Intro to c programming
 
StackArray stack3
StackArray stack3StackArray stack3
StackArray stack3
 
Vcs8
Vcs8Vcs8
Vcs8
 
Matlab code for secant method
Matlab code for secant methodMatlab code for secant method
Matlab code for secant method
 
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートIIopenFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
openFrameworks – 関数・クラス、オブジェクト指向プログラミング導入 - 多摩美メディアアートII
 
Avl tree
Avl treeAvl tree
Avl tree
 
Stack using Array
Stack using ArrayStack using Array
Stack using Array
 
Stack Data Structure
Stack Data StructureStack Data Structure
Stack Data Structure
 
C Language - Switch and For Loop
C Language - Switch and For LoopC Language - Switch and For Loop
C Language - Switch and For Loop
 
Data Structure - 2nd Study
Data Structure - 2nd StudyData Structure - 2nd Study
Data Structure - 2nd Study
 

En vedette

INTRODUCCION DE LA BATALLA DE PICHINCHA
INTRODUCCION DE LA BATALLA DE PICHINCHAINTRODUCCION DE LA BATALLA DE PICHINCHA
INTRODUCCION DE LA BATALLA DE PICHINCHAJulio Alejandro
 
La batalla de pichincha ocurrió el 24 de mayo de 1822
La batalla de pichincha ocurrió el 24 de mayo de 1822La batalla de pichincha ocurrió el 24 de mayo de 1822
La batalla de pichincha ocurrió el 24 de mayo de 1822Jhonny Cardenas
 
Automation Maintenance: Keeping Production Lines Humming While Preserving Assets
Automation Maintenance: Keeping Production Lines Humming While Preserving AssetsAutomation Maintenance: Keeping Production Lines Humming While Preserving Assets
Automation Maintenance: Keeping Production Lines Humming While Preserving AssetsARC Advisory Group
 
Morgan's Fish and Chips
Morgan's Fish and ChipsMorgan's Fish and Chips
Morgan's Fish and ChipsstarKz
 

En vedette (7)

INTRODUCCION DE LA BATALLA DE PICHINCHA
INTRODUCCION DE LA BATALLA DE PICHINCHAINTRODUCCION DE LA BATALLA DE PICHINCHA
INTRODUCCION DE LA BATALLA DE PICHINCHA
 
La batalla de pichincha ocurrió el 24 de mayo de 1822
La batalla de pichincha ocurrió el 24 de mayo de 1822La batalla de pichincha ocurrió el 24 de mayo de 1822
La batalla de pichincha ocurrió el 24 de mayo de 1822
 
Automation Maintenance: Keeping Production Lines Humming While Preserving Assets
Automation Maintenance: Keeping Production Lines Humming While Preserving AssetsAutomation Maintenance: Keeping Production Lines Humming While Preserving Assets
Automation Maintenance: Keeping Production Lines Humming While Preserving Assets
 
Morgan's Fish and Chips
Morgan's Fish and ChipsMorgan's Fish and Chips
Morgan's Fish and Chips
 
Soluciones
SolucionesSoluciones
Soluciones
 
Imc Project
Imc ProjectImc Project
Imc Project
 
Surfing the Agile Wave
Surfing the Agile WaveSurfing the Agile Wave
Surfing the Agile Wave
 

Similaire à Taller De Scilab

Ejercicios Scilab Completo
Ejercicios Scilab CompletoEjercicios Scilab Completo
Ejercicios Scilab CompletoRicardo Grandas
 
Numerical Methods in C
Numerical Methods in CNumerical Methods in C
Numerical Methods in CAmbili Baby
 
Intro to Functional Programming Workshop (code4lib)
Intro to Functional Programming Workshop (code4lib)Intro to Functional Programming Workshop (code4lib)
Intro to Functional Programming Workshop (code4lib)Will Kurt
 
MATLABAssignment 2Bracketing (Multiple Roots) (4)Bisection .docx
MATLABAssignment 2Bracketing (Multiple Roots) (4)Bisection .docxMATLABAssignment 2Bracketing (Multiple Roots) (4)Bisection .docx
MATLABAssignment 2Bracketing (Multiple Roots) (4)Bisection .docxandreecapon
 
Csci101 lect04 advanced_selection
Csci101 lect04 advanced_selectionCsci101 lect04 advanced_selection
Csci101 lect04 advanced_selectionElsayed Hemayed
 
From Javascript To Haskell
From Javascript To HaskellFrom Javascript To Haskell
From Javascript To Haskellujihisa
 
Introduction to Functional Programming with Haskell and JavaScript
Introduction to Functional Programming with Haskell and JavaScriptIntroduction to Functional Programming with Haskell and JavaScript
Introduction to Functional Programming with Haskell and JavaScriptWill Kurt
 
Floating point basicsThe core idea of floating-point representatio.pdf
Floating point basicsThe core idea of floating-point representatio.pdfFloating point basicsThe core idea of floating-point representatio.pdf
Floating point basicsThe core idea of floating-point representatio.pdfinfo235816
 
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdfIncorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdfaartechindia
 
Fp in scala part 2
Fp in scala part 2Fp in scala part 2
Fp in scala part 2Hang Zhao
 
Numerical Algorithm for a few Special Functions
Numerical Algorithm for a few Special FunctionsNumerical Algorithm for a few Special Functions
Numerical Algorithm for a few Special FunctionsAmos Tsai
 
Assignment on Numerical Method C Code
Assignment on Numerical Method C CodeAssignment on Numerical Method C Code
Assignment on Numerical Method C CodeSyed Ahmed Zaki
 
Javascript Uncommon Programming
Javascript Uncommon ProgrammingJavascript Uncommon Programming
Javascript Uncommon Programmingjeffz
 

Similaire à Taller De Scilab (20)

Ejercicios Scilab Completo
Ejercicios Scilab CompletoEjercicios Scilab Completo
Ejercicios Scilab Completo
 
Numerical Methods in C
Numerical Methods in CNumerical Methods in C
Numerical Methods in C
 
Es84
Es84Es84
Es84
 
Intro to Functional Programming Workshop (code4lib)
Intro to Functional Programming Workshop (code4lib)Intro to Functional Programming Workshop (code4lib)
Intro to Functional Programming Workshop (code4lib)
 
Session07 recursion
Session07 recursionSession07 recursion
Session07 recursion
 
Assignment 3
Assignment 3Assignment 3
Assignment 3
 
MATLABAssignment 2Bracketing (Multiple Roots) (4)Bisection .docx
MATLABAssignment 2Bracketing (Multiple Roots) (4)Bisection .docxMATLABAssignment 2Bracketing (Multiple Roots) (4)Bisection .docx
MATLABAssignment 2Bracketing (Multiple Roots) (4)Bisection .docx
 
Csci101 lect04 advanced_selection
Csci101 lect04 advanced_selectionCsci101 lect04 advanced_selection
Csci101 lect04 advanced_selection
 
Numerical methods generating polynomial
Numerical methods generating polynomialNumerical methods generating polynomial
Numerical methods generating polynomial
 
matlab codes.pdf
matlab codes.pdfmatlab codes.pdf
matlab codes.pdf
 
From Javascript To Haskell
From Javascript To HaskellFrom Javascript To Haskell
From Javascript To Haskell
 
Introduction to Functional Programming with Haskell and JavaScript
Introduction to Functional Programming with Haskell and JavaScriptIntroduction to Functional Programming with Haskell and JavaScript
Introduction to Functional Programming with Haskell and JavaScript
 
Floating point basicsThe core idea of floating-point representatio.pdf
Floating point basicsThe core idea of floating-point representatio.pdfFloating point basicsThe core idea of floating-point representatio.pdf
Floating point basicsThe core idea of floating-point representatio.pdf
 
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdfIncorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
 
Fp in scala part 2
Fp in scala part 2Fp in scala part 2
Fp in scala part 2
 
Numerical Algorithm for a few Special Functions
Numerical Algorithm for a few Special FunctionsNumerical Algorithm for a few Special Functions
Numerical Algorithm for a few Special Functions
 
Assignment on Numerical Method C Code
Assignment on Numerical Method C CodeAssignment on Numerical Method C Code
Assignment on Numerical Method C Code
 
Feature Extraction
Feature ExtractionFeature Extraction
Feature Extraction
 
Javascript Uncommon Programming
Javascript Uncommon ProgrammingJavascript Uncommon Programming
Javascript Uncommon Programming
 
Assignmnt 4
Assignmnt 4Assignmnt 4
Assignmnt 4
 

Dernier

APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 

Dernier (20)

APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 

Taller De Scilab

  • 1. ANDRES FELIPE RENTERIA MARTINEZ 2303517 CODIGO DEL PROGRAMA SCILAB 1.) Punto de biseccion function y=f(x) y=-12.4+10*(0.5*%pi-asin(x/1)-x*(1-x**2)**0.5); endfunction function xr=biseccion(xai,xbi,tol) i=1; ea(1)=100; if f(xai)*f(xbi) < 0 xa(1)=xai; xb(1)=xbi; xr(1)=(xa(1)+xb(1))/2; printf('It.tt Xatt Xbtt Xrtt f(Xr)t Error n'); printf('%2d t %11.7f t %11.7f t %11.7f t %11.7f n',i,xa(i),xb(i),xr(i),f(xr(i))); while abs(ea(i)) >= tol if f(xa(i))*f(xr(i))< 0 xa(i+1)=xa(i); xb(i+1)=xr(i); end if f(xa(i))*f(xr(i))> 0 xa(i+1)=xr(i); xb(i+1)=xb(i);
  • 2. end xr(i+1)=(xa(i+1)+xb(i+1))/2; ea(i+1)=abs((xr(i+1)-xr(i))/(xr(i+1))); printf('%2d t %11.7f t %11.7f t %11.7f t %11.7f t %7.6f n',i+1,xa(i+1),xb(i+1),xr(i+1),f(xr(i+1)),ea(i+1)); i=i+1; end else printf('No existe una raíz en ese intervalo'); end endfunction 2.)punto de Newton-Rapson function y=f(x) y=2*x**3+x-1; endfunction function y=df(x) y=6*x**2+1; endfunction function x=newtonraphson(x0,tol); i=1; ea(1)=100; x(1)=x0;
  • 3. while abs(ea(i))>=tol; x(i+1)=x(i)-f(x(i))/df(x(i)); ea(i+1)=abs((x(i+1)-x(i))/x(i+1)); i=i+1; end printf(' i t X(i) Error aprox (i) n'); for j=1:i; printf('%2d t %11.7f t %7.6f n',j-1,x(j),ea(j)); end endfunction 3.) Punto de Interacion del punto fijo function y=g(x) y=300-80.425*x+201.0625*(1-exp(-(0.1)*x/0.25)); endfunction function x=puntofijo(x0,tol) i=1; ea(1)=100; x(1)=x0; while abs(ea(i))>=tol, x(i+1) = g(x(i)); ea(i+1) = abs((x(i+1)-x(i))/x(i+1)); i=i+1; end printf(' i t X(i) Error aprox (i) n');
  • 4. for j=1:i; printf('%2d t %11.7f t %7.3f n',j-1,x(j),ea(j)); end endfunction 4.) A)Newton function y=f(x) y=4*cos(x)-exp(x); endfunction function y=df(x) y=-4*sin(x)-exp(x); endfunction function x=newtonraphson(x0,tol); i=1; ea(1)=100; x(1)=x0; while abs(ea(i))>=tol; x(i+1)=x(i)-f(x(i))/df(x(i)); ea(i+1)=abs((x(i+1)-x(i))/x(i+1)); i=i+1; end printf(' i t X(i) Error aprox (i) n'); for j=1:i;
  • 5. printf('%2d t %11.7f t %7.6f n',j-1,x(j),ea(j)); end endfunction B) Metodo de la Secante function y=f(x) y=4*cos(x)-exp(x); endfunction function x = secante(x0,x1,tol) j=2; i=1; x(1)=x0; x(2)=x1; ea(i)=100; while abs(ea(i))>=tol x(j+1)=(x(j-1)*f(x(j))-x(j)*f(x(j-1)))/(f(x(j))-f(x(j-1))); ea(i+1)=abs((x(j+1)-x(j))/x(j+1)); j=j+1; i=i+1; end printf(' i tt x(i) t Error aprox (i) n'); printf('%2d t %11.7f t n',0,x(1)); for k=2:j;
  • 6. printf('%2d t %11.7f t %7.3f n',k-1,x(k),ea(k-1)); end endfunction 5.) A) Metodo de la secante function y=f(x) y=x**2-6; endfunction function x = secante(x0,x1,tol) j=2; i=1; x(1)=x0; x(2)=x1; ea(i)=100; while abs(ea(i))>=tol x(j+1)=(x(j-1)*f(x(j))-x(j)*f(x(j-1)))/(f(x(j))-f(x(j-1))); ea(i+1)=abs((x(j+1)-x(j))/x(j+1)); j=j+1; i=i+1; end printf(' i tt x(i) t Error aprox (i) n'); printf('%2d t %11.7f t n',0,x(1));
  • 7. for k=2:j; printf('%2d t %11.7f t %7.3f n',k-1,x(k),ea(k-1)); end endfunction 5.) B)Falsa Posicion function y=f(x) y=x**2-6; endfunction function xr=reglafalsa(xai,xbi,tol) i=1; ea(1)=100; if f(xai)*f(xbi) < 0 xa(1)=xai; xb(1)=xbi; xr(1)=xa(1)-f(xa(1))*(xb(1)-xa(1))/(f(xb(1))-f(xa(1))); printf('It. Xa Xb Xr f(Xr) Error aprox %n'); printf('%2d t %11.7f t %11.7f t %11.7ft %11.7f n',i,xa(i),xb(i),xr(i),f(xr(i))); while abs(ea(i))>=tol, if f(xa(i))*f(xr(i))< 0 xa(i+1)=xa(i);
  • 8. xb(i+1)=xr(i); end if f(xa(i))*f(xr(i))> 0 xa(1)=xr(i); xb(1)=xb(i); end xr(i+1)=xa(i+1)-f(xa(i+1))*(xb(i+1)-xa(i+1))/(f(xb(i+1))-f(xa(i+1))); ea(i+1)=abs((xr(i+1)-xr(i))/(xr(i+1))); printf('%2d t %11.7f t %11.7f t %11.7f t %11.7ft %7.3f n', i+1,xa(i+1),xb(i+1),xr(i+1),f(xr(i+1)),ea(i+1)); i=i+1; end else printf('No existe una raíz en ese intervalo'); end endfunction