作者koujiuhara19 (亨爷)
看板NTU-Exam
标题[试题] 99上 王伟仲 计算数学导论 期中考(上机部分)
时间Tue Nov 9 00:42:43 2010
课程名称︰计算数学导论
课程性质︰数学系必修
课程教师︰王伟仲
开课学院:理学院
开课系所︰数学系
考试日期(年月日)︰99.11.08
考试时限(分钟):110min
是否需发放奖励金:是
(如未明确表示,则不予发放)
试题 :
2010 Computational Mathematics Midterm Coding Exam
Nov 8th, 2010
Problem 1.
(a)[3%]Construct a 20 ×20 matrix A whose main diagonal elements are 1,
2,..,20 and the first lower off-diagonal are 219,218..,201.(b)[3%]Construct
a 20 ×1 random vector b.(c)Give the solution formulas of x(i), for i=1..,20
,and then write a MATLAB code to solve Ax=b by using for-loop.
Problem 2.
[8%]Write MATLAB codes to implement the following algorithm.
Let f(t,x)=2x/t+t^(2)e^(t)
INPUT endpoints a,b; integer N; initial condition α
OUTPUT approximation ω to y at the (N+1) values of t.
Step 1
set h=(b-a)/N ;
t=a
ω=α
OUTPUT(t,ω)
Step 2
For i=1,2.......,N do Step 3,4.
Step 3
Setω=ω+h(t,ω); (Compute ωi.)
t=a+ih. (Compute ti. )
Step 4
OUTPUT(t,ω)
Step 5 STOP.
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.247.157