首页 > 其他分享 >MATH2033 Introduction to Scientific Computation

MATH2033 Introduction to Scientific Computation

时间:2024-12-17 19:32:12浏览次数:9  
标签:Scientific Introduction type py shape Computation input numpy ndarray

MATH2033 Introduction to Scientific Computation

— Coursework 2 — Submission deadline: 15:00 Friday 20 December 2024 This coursework contributes 10% towards your mark for this module.

Rules It is not permitted to use generative artificial intelligence (AI) software for this coursework. Ensure thatyou have read and have understood the Policy on academic misconduct. One of the things stated inthis policy is that “The submission of work that is generated and/orimproved by software that is notpermitted for that assessment, for the purpose of gaining marks will be regarded as false authorshipand seen as an attempt to gain an unpermitted academic advantage”.This coursework should be your own individual work, with the exceptions that:

  1. You may ask for and receive help from the lecturer Richard Rankin although not all questions will beanswered and those that are will be answered to all students that attend the class.
  1. You may copy from material provided on the Moodle pages:
  • Introduction to Scientific Computation (MATH2033 UNNC) (FCH1 24-25)
  • Analytical and Computational Foundations (MATH1028 UNNC) (FCH1 23-24)
  • Calculus (MATH1027 UNNC) (FCH1 23-24)
  • Linear Mathematics (MATH1030 UNNC) (FCH1 23-24)

Coding Environment You should write and submit a py file. You are strongly encouraged to use the Spyder IDE (integrateddevelopment environment). You should not write or submit an ipynb file and so you should not use

Jupyter NotebookIt will be assumed that numpy is imported as np, and that matplotlib.pyplot is imported as plt.Submission Procedure: To submit, upload your linear systems.py file through the Coursework 2 assignment activity in theCoursework 2 section of the Moodle page Introduction to Scientific Computation (MATH2033 UNNC)(FCH1 24-25).Marking Your linear systems.py file will be mainly marked by running your functions with certain inputs and comparing the output with the correct output.Department of Mathematical SciencesPage 1 of 51. The linear systems.py file contains an unfinished function with the following first line:def smax (w ,s , i ) :

Assume that:

  • The type of the input w is numpy.ndarray.
  • The type of the input s is numpy.ndarray.
  • The type of the input i is int.
  • There exists an int n such that the shape of w is (n,) and the shape of s is (n,).
  • The input i is a nonnegative integer that is less than n.Complete the function smax so that it returns an int p which is the smallest integer for which

. A test that you can perform on your function smax is to run the Question 1 cell of the tests.py fileand check that what is printed is:1[20 marks] Coursework 2Page 2 of 52. Suppose that A R n×n, that det(A) = 0 and that b R n.The linear systems.py file contains an unfinished function with the following first line:def spp (A ,b , c ) :Assume that:

  • The type of the input A is numpy.ndarray.
  • The type of the input b is numpy.ndarray.
  • The type of the input c is int.
  • There exists an int n such that n > 1, the shape of A is (n,n) and the shape of b is (n,1).
  • The input A represents A.
  • The input b represents b.
  • The input c is a positive integer that is less than n.Complete the function spp so that it returns a tuple (U, v) where:
  • U is a numpy.ndarray with shape (n,n) that 代写MATH2033 Introduction to Scientific Computation represents the matrix comprised of the first ncolumns of the matrix arrived at by performing forward elimination withscaled partial pivotingon the matrix  A b  until all of the entries below the main diagonal in the first c columns are0.v is a numpy.ndarray with shape (n,1) that represents the last column of the matrix arrived atby performing forward elimination with scaled partial pivoting on matrix  A b  until all ofthe entries below the main diagonal in the first c columns are 0.A test that you can perform on your function spp is to run the Question 2 cell of the tests.py filand check that what is printed is:Coursework 2Page 3 of 53. Suppose that A R n×n, that det(A) = 0, that all of the entries on the main diagonal of A arnonzero and that b R n. Let x R n be the solution to Ax = b. Let x (k) be the approximation to x obtained after performing k iterations of the Gauss–Seidel method starting with the initialapproximation x (0) .The linear systems.py file contains an unfinished function with the following first line:

def GS (A ,b ,g ,t , N ) :Assume that:

  • The type of the input A is numpy.ndarray.
  • The type of the input b is numpy.ndarray.
  • The type of the input g is numpy.ndarray.
  • The type of the input t is numpy.float64, float or int.
  • The type of the input N is int.
  • There exists an int n such that the shape of A is (n,n), the shape of b is (n,1) and the shapeof g is (n,1).
  • The input A represents A.
  • The input b represents b.
  • The input g represents x (0) .
  • The input t is a real number.
  • The input N is a nonnegative integer.Complete the function GS so that it returns a tuple (y, r) where:
  • y is a numpy.ndarray with shape (n, M + 1) which is such that, for j = 0, 1, . . . , n 1,

 

标签:Scientific,Introduction,type,py,shape,Computation,input,numpy,ndarray
From: https://www.cnblogs.com/CSE2425/p/18611605

相关文章

  • SciTech-Logic:逻辑学-Introduction to Logic: Irvine - 5.5 传统对当方阵
    SciTech-Logic:逻辑学-IntroductiontoLogic:Irvine-5.5传统对当方阵5.5传统对当方阵到目前为止,对直言命题的分析使我们能够进一步研究这些直言命题之间的关系,这也转而为我们日常生活中的许多推理提供了可靠的基础。我们需要另一个技术术语即对当。具有相同主项和相同谓......
  • SciTech-Logic:逻辑学-Introduction to Logic: Irvine - 5.4 质、量 与 周延性
    SciTech-Logic:逻辑学-IntroductiontoLogic:Irvine-5.2ClassandStatement类与直言命题A.质我们已经看到,每个标准直言命题或是肯定或是否定了某类关系。如果一个命题肯定了类与类之间的包含关系,不管是全部地还是部分地肯定,那么,它的质就是肯定的。因此,A命题(“所有S是P......
  • SciTech-Logic:逻辑学-Introduction to Logic: Irvine - 5.2 Class and Statement 类
    类与直言命题亚里士多德三段论逻辑,主要探讨的是关于不同对象类之间相互关系的论证。Class:类Class类,指的是共有certainspecificproperty:某种特定属性的objects:所有对象的collection:汇集。第3章在解释词项内涵的定义时,已经简单地介绍过"class:类"这个概念。Relationso......
  • JC4004 – Computational Intelligence
    Programmingassignment–Groupworkbyateamof4-5studentsTitle:JC4004–ComputationalIntelligenceNote:Thisassignmentaccountsfor30%ofthetotalmarkofthecourse.Deadline:SubmittheassignmentinMyAberdeenby19.December2024at23:00(Chi......
  • JC4004 Computational Intelligence
    Programmingassignment–Groupworkbyateamof4-5studentsTitle:JC4004–ComputationalIntelligenceNote:Thisassignmentaccountsfor30%ofthetotalmarkofthecourse.Deadline:SubmittheassignmentinMyAberdeenby19.December2024at23:00(C......
  • Introduction to the Explicit Finite Element Method for Nonlinear Transient Dynam
    第一部分基础知识20第1章引言201.1模拟时代与计算机辅助工程201.1.1模拟的世界201.1.2显式有限元方法的发展211.1.3计算机辅助工程CAE——机遇和挑战221.2预备知识231.2.1符号231.2.2弹性本构关系25第2章非线性瞬态动力学显式有限......
  • Introduction to Systems Programming .
    IntroductiontoSystemsProgramming................................................................Assignment2Accompanyingthisassignmentyouwillfindanarchivefilegt2048.zip.Thezip......
  • CS-UY 4563 - Introduction to Machine Learning
    FinalProjectCS-UY4563-IntroductiontoMachineLearningOverviewPartnerwithonestudentandselectamachinelearningproblemofyourchoice.Applythemachinelearningtechniquesyou’velearnedduringthecoursetoyourchosenproblem.Present......
  • CCIT4020 Introduction to Computer
     CCIT4020IntroductiontoComputerProgrammingAssignment3–SectionCGeneralguidelines:Useconciseanddirecttechniques/programcodeswelearninourcourse.Uselessorover-complicatedtechniques/programcodesmaybeignoredorpenalized.Stud......
  • COMP42215 Introduction to Computer Science
    INTRODUCTIONTOCOMPUTERSCIENCE2024/2025MastersProgrammesCourseworkAdministrativeDetailsModule/LectureCourse:COMP42215IntroductiontoComputerScienceeadlineforsubmission:14:00Friday13thDecember2024Workreturned:WeekBeginning13th......