SlideShare ist ein Scribd-Unternehmen logo
1 von 4
Downloaden Sie, um offline zu lesen
AMTH250                                                          Assignment 6
                       Due: 24th September, 2012



Question 1 [3 marks]
   Evaluate the following integrals using quad:
                                 ∞
                                        x3
                 (a) I1 =                    dx
                             0        ex − 1
                                 1
                 (b) I2 =            ln(1 + x) ln(1 − x) dx
                             −1
                              π
                 (c) I3 =            (tan(sin x) − sin(tan x)) dx
                             0

Do you think the results are reliable?
Question 2 [3 marks]
   The intensity of diffracted light near a straight edge is determined by
the Fresnel integrals
                                            x
                                                      πt2
                         C(x) =                 cos         dt
                                        0              2

and
                                            x
                                                      πt2
                         S(x) =                 sin         dt
                                        0              2

Use quad to evaluate these integrals for enough values of x to draw smooth
plots of C(x) and S(x) over the range −10 ≤ x ≤ 10. Also plot C(x) against
S(x) — the result is the Cornu or Euler spiral.
Question 3 [3 marks]
   Use Monte-Carlo methods to

 (a) Estimate the volume of the ellipsoid

                                                y2   z2
                                     x2 +          +    ≤ 1.
                                                4    16




                                                1
(b) Estimate the double integral
                                         √
                                           2  2
                                       e− x +y dx dy
                                   Ω

     over the semicircular region Ω defined by

                                x2 + y 2 ≤ 1,   x ≥ 0.


Question 4 [3 marks]
  The initial value problem
                          dy
                             = −2ty,        y(0) = 1
                          dt
has the solution
                                            2
                                  y(t) = e−t
Apply Euler’s method with various step-sizes h to this problem.

 (a) Solve the initial value problem on the interval [0, 1]. As a measure
     of error, compare the computed and exact values at t = 1. Plot and
     characterize the error as a function of the step-size h.

 (b) The exact solution decays to 0 as t → ∞. A numerical method for
     this problem is unstable if it does not decay to 0 as t → ∞. Determine
     the range of step-sizes h for which Euler’s method is unstable for this
     problem.

Question 5 [4 marks]
  The system of differential equations
                          dy1
                                 = σ(y2 − y1 )
                           dt
                          dy2
                                 = ry1 − y2 − y1 y3
                           dt
                          dy3
                                 = y1 y2 − by3
                           dt
was used by Lorenz as a crude model of atmospheric circulation.
    Take σ = 10, b = 8/3 and r = 28 and initial values y1 (0) = 0, y2 (0) = 1
and y3 (0) = 0 and use lsode to solve the differential equation from t = 0 to
t = 100. Plot (a) each component individually, (b) phase plots of each pair
of components, and (c) a 3D plot of the curve (y1 (t), y2 (t), y3 (t)).
    Now experiment by changing the initial conditions by a tiny amount. De-
scribe how the graphs above and the final values (y1 (100), y2 (100), y3 (100))
change.

                                        2
Notes on the Assignment

Question 2
You will need a for loop to generate the vectors of values of C(x) and S(x).
A step of 0.01 gives reasonable results, so try something like
x = -10:0.01:10;
.....
for i = 1:length(x)
  % evaluate C(x(i)) & S(x(i))
end

Questions 3
It is easy to get these wrong. Some things to watch out for:
  1. First identify the range of the random numbers for each dimension,
     e.g. y ∈ [0, 2].
  2. Use rand correctly, e.g. for y ∈ [0, 2] use 2*rand(1,1) not rand(0,2).
  3. Make sure you account for the volume of the region in which you
     generate the random numbers.
If in doubt, study the examples in the notes carefully making sure you
understand each step in the computation. Beware that the lines
    x = rand(1,4);    % x = point in unit cube
    if (norm(x) <= 1) % point x lies in sphere
in the example of §1.6.3 are quite specific to that particular problem.

Questions 4
This is the same differential equation that was used as an example in the
notes.
   (a) Try step sizes h = 1/2, 1/4, 1/8, . . . . You will need a for loop to
generate the data. Start with something like
N = 16;
h = zeros(1,N);
y1 = zeros(1,N);   % values of y at t=1
for k = 1:N
  hk = 2^-k;
  h(k) = hk;
  y =euler(f, 0, 1, hk, 2^k); % 2^k steps needed to reach t=1
  y1(k) = y(end);             % y(end) is the last element of y
end

                                     3
(b) The example at the top of p25 of the notes shows Euler’s method is
unstable for h = 1.

Question 5
  1. See the example in the notes on the Lotka-Volterra equations for how
     to solve this sort of problem in Octave.

  2. See §3.4 of the Octave notes for plotting 3D curves.

  3. The initial values are [0 1 0]. For a small change in initial values,
     try adding 1e-10*randn(1,3) for example.




                                    4

Weitere ähnliche Inhalte

Was ist angesagt?

Midpoint circle algo
Midpoint circle algoMidpoint circle algo
Midpoint circle algoMohd Arif
 
AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSE
AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSEAU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSE
AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSEThiyagarajan G
 
Jacobi iterative method
Jacobi iterative methodJacobi iterative method
Jacobi iterative methodLuckshay Batra
 
Ellipses drawing algo.
Ellipses drawing algo.Ellipses drawing algo.
Ellipses drawing algo.Mohd Arif
 
Integration
IntegrationIntegration
Integrationlecturer
 
Applied numerical methods lec9
Applied numerical methods lec9Applied numerical methods lec9
Applied numerical methods lec9Yasser Ahmed
 
Lec05 circle ellipse
Lec05 circle ellipseLec05 circle ellipse
Lec05 circle ellipseMaaz Rizwan
 
Lab lecture 1 line_algo
Lab lecture 1 line_algoLab lecture 1 line_algo
Lab lecture 1 line_algosimpleok
 
Image Processing 3
Image Processing 3Image Processing 3
Image Processing 3jainatin
 
Differentiation jan 21, 2014
Differentiation jan 21, 2014Differentiation jan 21, 2014
Differentiation jan 21, 2014Mohammed Ahmed
 
Circle drawing algo.
Circle drawing algo.Circle drawing algo.
Circle drawing algo.Mohd Arif
 
Newton’s Divided Difference Formula
Newton’s Divided Difference FormulaNewton’s Divided Difference Formula
Newton’s Divided Difference FormulaJas Singh Bhasin
 

Was ist angesagt? (20)

Midpoint circle algo
Midpoint circle algoMidpoint circle algo
Midpoint circle algo
 
AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSE
AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSEAU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSE
AU QP Answer key NOv/Dec 2015 Computer Graphics 5 sem CSE
 
Jacobi iterative method
Jacobi iterative methodJacobi iterative method
Jacobi iterative method
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Ellipses drawing algo.
Ellipses drawing algo.Ellipses drawing algo.
Ellipses drawing algo.
 
Sect1 4
Sect1 4Sect1 4
Sect1 4
 
Integration
IntegrationIntegration
Integration
 
Applied numerical methods lec9
Applied numerical methods lec9Applied numerical methods lec9
Applied numerical methods lec9
 
Lec05 circle ellipse
Lec05 circle ellipseLec05 circle ellipse
Lec05 circle ellipse
 
Ch02 2
Ch02 2Ch02 2
Ch02 2
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
Dda line-algorithm
Dda line-algorithmDda line-algorithm
Dda line-algorithm
 
Line circle draw
Line circle drawLine circle draw
Line circle draw
 
Lab lecture 1 line_algo
Lab lecture 1 line_algoLab lecture 1 line_algo
Lab lecture 1 line_algo
 
Image Processing 3
Image Processing 3Image Processing 3
Image Processing 3
 
Cs580
Cs580Cs580
Cs580
 
Day 01
Day 01Day 01
Day 01
 
Differentiation jan 21, 2014
Differentiation jan 21, 2014Differentiation jan 21, 2014
Differentiation jan 21, 2014
 
Circle drawing algo.
Circle drawing algo.Circle drawing algo.
Circle drawing algo.
 
Newton’s Divided Difference Formula
Newton’s Divided Difference FormulaNewton’s Divided Difference Formula
Newton’s Divided Difference Formula
 

Ähnlich wie Assignment6

Engr 213 final 2009
Engr 213 final 2009Engr 213 final 2009
Engr 213 final 2009akabaka12
 
Emat 213 midterm 1 winter 2006
Emat 213 midterm 1 winter 2006Emat 213 midterm 1 winter 2006
Emat 213 midterm 1 winter 2006akabaka12
 
Review for the Third Midterm of Math 150 B 11242014Probl.docx
Review for the Third Midterm of Math 150 B 11242014Probl.docxReview for the Third Midterm of Math 150 B 11242014Probl.docx
Review for the Third Midterm of Math 150 B 11242014Probl.docxjoellemurphey
 
Physical Chemistry Assignment Help
Physical Chemistry Assignment HelpPhysical Chemistry Assignment Help
Physical Chemistry Assignment HelpEdu Assignment Help
 
Amth250 octave matlab some solutions (1)
Amth250 octave matlab some solutions (1)Amth250 octave matlab some solutions (1)
Amth250 octave matlab some solutions (1)asghar123456
 
Maths assignment
Maths assignmentMaths assignment
Maths assignmentNtshima
 
Applications of Differential Calculus in real life
Applications of Differential Calculus in real life Applications of Differential Calculus in real life
Applications of Differential Calculus in real life OlooPundit
 
ISI MSQE Entrance Question Paper (2008)
ISI MSQE Entrance Question Paper (2008)ISI MSQE Entrance Question Paper (2008)
ISI MSQE Entrance Question Paper (2008)CrackDSE
 
Engr 213 midterm 2b sol 2010
Engr 213 midterm 2b sol 2010Engr 213 midterm 2b sol 2010
Engr 213 midterm 2b sol 2010akabaka12
 
GATE Mathematics Paper-2000
GATE Mathematics Paper-2000GATE Mathematics Paper-2000
GATE Mathematics Paper-2000Dips Academy
 
Integration techniques
Integration techniquesIntegration techniques
Integration techniquesKrishna Gali
 
Binomial theorem for any index
Binomial theorem for any indexBinomial theorem for any index
Binomial theorem for any indexindu psthakur
 
Engr 213 midterm 2a sol 2010
Engr 213 midterm 2a sol 2010Engr 213 midterm 2a sol 2010
Engr 213 midterm 2a sol 2010akabaka12
 
ISI MSQE Entrance Question Paper (2010)
ISI MSQE Entrance Question Paper (2010)ISI MSQE Entrance Question Paper (2010)
ISI MSQE Entrance Question Paper (2010)CrackDSE
 

Ähnlich wie Assignment6 (20)

Engr 213 final 2009
Engr 213 final 2009Engr 213 final 2009
Engr 213 final 2009
 
Emat 213 midterm 1 winter 2006
Emat 213 midterm 1 winter 2006Emat 213 midterm 1 winter 2006
Emat 213 midterm 1 winter 2006
 
Review for the Third Midterm of Math 150 B 11242014Probl.docx
Review for the Third Midterm of Math 150 B 11242014Probl.docxReview for the Third Midterm of Math 150 B 11242014Probl.docx
Review for the Third Midterm of Math 150 B 11242014Probl.docx
 
Physical Chemistry Assignment Help
Physical Chemistry Assignment HelpPhysical Chemistry Assignment Help
Physical Chemistry Assignment Help
 
Amth250 octave matlab some solutions (1)
Amth250 octave matlab some solutions (1)Amth250 octave matlab some solutions (1)
Amth250 octave matlab some solutions (1)
 
Maths assignment
Maths assignmentMaths assignment
Maths assignment
 
Double integration
Double integrationDouble integration
Double integration
 
Online Maths Assignment Help
Online Maths Assignment HelpOnline Maths Assignment Help
Online Maths Assignment Help
 
Online Maths Assignment Help
Online Maths Assignment HelpOnline Maths Assignment Help
Online Maths Assignment Help
 
Applications of Differential Calculus in real life
Applications of Differential Calculus in real life Applications of Differential Calculus in real life
Applications of Differential Calculus in real life
 
Assignment5
Assignment5Assignment5
Assignment5
 
ISI MSQE Entrance Question Paper (2008)
ISI MSQE Entrance Question Paper (2008)ISI MSQE Entrance Question Paper (2008)
ISI MSQE Entrance Question Paper (2008)
 
Chapter 3 (maths 3)
Chapter 3 (maths 3)Chapter 3 (maths 3)
Chapter 3 (maths 3)
 
Lecture_note2.pdf
Lecture_note2.pdfLecture_note2.pdf
Lecture_note2.pdf
 
Engr 213 midterm 2b sol 2010
Engr 213 midterm 2b sol 2010Engr 213 midterm 2b sol 2010
Engr 213 midterm 2b sol 2010
 
GATE Mathematics Paper-2000
GATE Mathematics Paper-2000GATE Mathematics Paper-2000
GATE Mathematics Paper-2000
 
Integration techniques
Integration techniquesIntegration techniques
Integration techniques
 
Binomial theorem for any index
Binomial theorem for any indexBinomial theorem for any index
Binomial theorem for any index
 
Engr 213 midterm 2a sol 2010
Engr 213 midterm 2a sol 2010Engr 213 midterm 2a sol 2010
Engr 213 midterm 2a sol 2010
 
ISI MSQE Entrance Question Paper (2010)
ISI MSQE Entrance Question Paper (2010)ISI MSQE Entrance Question Paper (2010)
ISI MSQE Entrance Question Paper (2010)
 

Mehr von asghar123456

Answers assignment 5 open channel hydraulics-fluid mechanics
Answers assignment 5 open channel hydraulics-fluid mechanicsAnswers assignment 5 open channel hydraulics-fluid mechanics
Answers assignment 5 open channel hydraulics-fluid mechanicsasghar123456
 
Answers assignment 4 real fluids-fluid mechanics
Answers assignment 4 real fluids-fluid mechanicsAnswers assignment 4 real fluids-fluid mechanics
Answers assignment 4 real fluids-fluid mechanicsasghar123456
 
Answers assignment 3 integral methods-fluid mechanics
Answers assignment 3 integral methods-fluid mechanicsAnswers assignment 3 integral methods-fluid mechanics
Answers assignment 3 integral methods-fluid mechanicsasghar123456
 
Answers assignment 2 fluid statics-fluid mechanics
Answers assignment 2 fluid statics-fluid mechanicsAnswers assignment 2 fluid statics-fluid mechanics
Answers assignment 2 fluid statics-fluid mechanicsasghar123456
 
assignment 1 properties of fluids-Fluid mechanics
assignment 1 properties of fluids-Fluid mechanicsassignment 1 properties of fluids-Fluid mechanics
assignment 1 properties of fluids-Fluid mechanicsasghar123456
 
Buckling test engt110
Buckling test engt110Buckling test engt110
Buckling test engt110asghar123456
 
Amth250 octave matlab some solutions (4)
Amth250 octave matlab some solutions (4)Amth250 octave matlab some solutions (4)
Amth250 octave matlab some solutions (4)asghar123456
 
Amth250 octave matlab some solutions (3)
Amth250 octave matlab some solutions (3)Amth250 octave matlab some solutions (3)
Amth250 octave matlab some solutions (3)asghar123456
 

Mehr von asghar123456 (9)

Answers assignment 5 open channel hydraulics-fluid mechanics
Answers assignment 5 open channel hydraulics-fluid mechanicsAnswers assignment 5 open channel hydraulics-fluid mechanics
Answers assignment 5 open channel hydraulics-fluid mechanics
 
Answers assignment 4 real fluids-fluid mechanics
Answers assignment 4 real fluids-fluid mechanicsAnswers assignment 4 real fluids-fluid mechanics
Answers assignment 4 real fluids-fluid mechanics
 
Answers assignment 3 integral methods-fluid mechanics
Answers assignment 3 integral methods-fluid mechanicsAnswers assignment 3 integral methods-fluid mechanics
Answers assignment 3 integral methods-fluid mechanics
 
Answers assignment 2 fluid statics-fluid mechanics
Answers assignment 2 fluid statics-fluid mechanicsAnswers assignment 2 fluid statics-fluid mechanics
Answers assignment 2 fluid statics-fluid mechanics
 
assignment 1 properties of fluids-Fluid mechanics
assignment 1 properties of fluids-Fluid mechanicsassignment 1 properties of fluids-Fluid mechanics
assignment 1 properties of fluids-Fluid mechanics
 
Buckling test engt110
Buckling test engt110Buckling test engt110
Buckling test engt110
 
Assignment4
Assignment4Assignment4
Assignment4
 
Amth250 octave matlab some solutions (4)
Amth250 octave matlab some solutions (4)Amth250 octave matlab some solutions (4)
Amth250 octave matlab some solutions (4)
 
Amth250 octave matlab some solutions (3)
Amth250 octave matlab some solutions (3)Amth250 octave matlab some solutions (3)
Amth250 octave matlab some solutions (3)
 

Kürzlich hochgeladen

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Kürzlich hochgeladen (20)

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Assignment6

  • 1. AMTH250 Assignment 6 Due: 24th September, 2012 Question 1 [3 marks] Evaluate the following integrals using quad: ∞ x3 (a) I1 = dx 0 ex − 1 1 (b) I2 = ln(1 + x) ln(1 − x) dx −1 π (c) I3 = (tan(sin x) − sin(tan x)) dx 0 Do you think the results are reliable? Question 2 [3 marks] The intensity of diffracted light near a straight edge is determined by the Fresnel integrals x πt2 C(x) = cos dt 0 2 and x πt2 S(x) = sin dt 0 2 Use quad to evaluate these integrals for enough values of x to draw smooth plots of C(x) and S(x) over the range −10 ≤ x ≤ 10. Also plot C(x) against S(x) — the result is the Cornu or Euler spiral. Question 3 [3 marks] Use Monte-Carlo methods to (a) Estimate the volume of the ellipsoid y2 z2 x2 + + ≤ 1. 4 16 1
  • 2. (b) Estimate the double integral √ 2 2 e− x +y dx dy Ω over the semicircular region Ω defined by x2 + y 2 ≤ 1, x ≥ 0. Question 4 [3 marks] The initial value problem dy = −2ty, y(0) = 1 dt has the solution 2 y(t) = e−t Apply Euler’s method with various step-sizes h to this problem. (a) Solve the initial value problem on the interval [0, 1]. As a measure of error, compare the computed and exact values at t = 1. Plot and characterize the error as a function of the step-size h. (b) The exact solution decays to 0 as t → ∞. A numerical method for this problem is unstable if it does not decay to 0 as t → ∞. Determine the range of step-sizes h for which Euler’s method is unstable for this problem. Question 5 [4 marks] The system of differential equations dy1 = σ(y2 − y1 ) dt dy2 = ry1 − y2 − y1 y3 dt dy3 = y1 y2 − by3 dt was used by Lorenz as a crude model of atmospheric circulation. Take σ = 10, b = 8/3 and r = 28 and initial values y1 (0) = 0, y2 (0) = 1 and y3 (0) = 0 and use lsode to solve the differential equation from t = 0 to t = 100. Plot (a) each component individually, (b) phase plots of each pair of components, and (c) a 3D plot of the curve (y1 (t), y2 (t), y3 (t)). Now experiment by changing the initial conditions by a tiny amount. De- scribe how the graphs above and the final values (y1 (100), y2 (100), y3 (100)) change. 2
  • 3. Notes on the Assignment Question 2 You will need a for loop to generate the vectors of values of C(x) and S(x). A step of 0.01 gives reasonable results, so try something like x = -10:0.01:10; ..... for i = 1:length(x) % evaluate C(x(i)) & S(x(i)) end Questions 3 It is easy to get these wrong. Some things to watch out for: 1. First identify the range of the random numbers for each dimension, e.g. y ∈ [0, 2]. 2. Use rand correctly, e.g. for y ∈ [0, 2] use 2*rand(1,1) not rand(0,2). 3. Make sure you account for the volume of the region in which you generate the random numbers. If in doubt, study the examples in the notes carefully making sure you understand each step in the computation. Beware that the lines x = rand(1,4); % x = point in unit cube if (norm(x) <= 1) % point x lies in sphere in the example of §1.6.3 are quite specific to that particular problem. Questions 4 This is the same differential equation that was used as an example in the notes. (a) Try step sizes h = 1/2, 1/4, 1/8, . . . . You will need a for loop to generate the data. Start with something like N = 16; h = zeros(1,N); y1 = zeros(1,N); % values of y at t=1 for k = 1:N hk = 2^-k; h(k) = hk; y =euler(f, 0, 1, hk, 2^k); % 2^k steps needed to reach t=1 y1(k) = y(end); % y(end) is the last element of y end 3
  • 4. (b) The example at the top of p25 of the notes shows Euler’s method is unstable for h = 1. Question 5 1. See the example in the notes on the Lotka-Volterra equations for how to solve this sort of problem in Octave. 2. See §3.4 of the Octave notes for plotting 3D curves. 3. The initial values are [0 1 0]. For a small change in initial values, try adding 1e-10*randn(1,3) for example. 4