同济大学:《Matlab在机械设计中的应用》课程电子教案(PPT课件)Chapter 08 Advanced Mathematics

8:Advanced Mathematics Part 1:Fitting Curves to Data Part 2:Symbolic Mathematics ▣Part3:Calculus CDHAW @月协大学 TONGJI UNIVERSITY
8: Advanced Mathematics Part 1: Fitting Curves to Data Part 2: Symbolic Mathematics Part 3: Calculus

Advanced Mathematics(1/34) Fitting Curves to Data In this part,selected advanced mathematics and related built-in functions in the MATLAB software are introduced. >Fitting a curve to the data is often desired.Curve fitting is finding the curve that best fits the data. MATLAB has several curve-fitting functions.Some of the simplest curves are polynomials of different degrees, which are described next. 日濟大学 AW TONGJI UNIVERSITY
➢ In this part, selected advanced mathematics and related built-in functions in the MATLAB software are introduced. ➢ Fitting a curve to the data is often desired. Curve fitting is finding the curve that best fits the data. ➢ MATLAB has several curve-fitting functions. Some of the simplest curves are polynomials of different degrees, which are described next. Advanced Mathematics(1/34) Fitting Curves to Data

Advanced Mathematics(2/34) Fitting Curves to Data Polynomials Simple curves are polynomials of different degrees or orders.The degree is the integer of the highest exponent in the expression. For example: A straight line is a first-order(or degree 1)polynomial of the form ax b,or more explicitly ax+b. A quadratic is a second-order (or degree 2)polynomial of the form ax2 +bx +c. A cubic (degree 3)is of the form ax3+bx2+cx+d. 翻月停大学 TONGJI UNIVERSITY
Advanced Mathematics(2/34) Fitting Curves to Data

Advanced Mathematics(3/34) Fitting Curves to Data The built-in functions sym2poly and poly2sym convert from symbolic expressions to polynomial vectors and vice versa. For example: >>myp=[12-43]: >poly2sym(myp) ans= x^3+2*×^2-4*X+3 >>mypo1y=[20-105]: >poly2sym(mypoly) ans= 2*x^4-×^2+5 >sym2poly (ans) ans @日济大学 2 TONGJIUNIVE具sITY
Advanced Mathematics(3/34) Fitting Curves to Data ➢ The built-in functions sym2poly and poly2sym convert from symbolic expressions to polynomial vectors and vice versa. For example:

Advanced Mathematics(4/34) Fitting Curves to Data The roots function in MATLAB can be used to find the roots of an equation represented by a polynomial. For example:for the mathematical function 4x3-2x2-8x+3 to solve the equation f(x)=0: >>roots([4-2-83]) ans= -1.3660 1.5000 0.3660 CDHAW @月协大学 TONGJI UNIVERSITY
Advanced Mathematics(4/34) Fitting Curves to Data

Advanced Mathematics(5/34) Fitting Curves to Data The function polyval will evaluate a polynomial p at x;the form is polyval(p,x). For example:the polynomial -2x2+x+4 is evaluated at x=3, which yields -2 9+3+4,or-11: >>p=[-2141: >polyval (p,3) ans >polyval(p,1:3) -11 ans= 3 -2 -11 The argument x can be a vector. >polyval(p,[5 7]) ans= AW -41 -87 同濟大学 TONGJIUNIVERSITY
Advanced Mathematics(5/34) Fitting Curves to Data The argument x can be a vector

Advanced Mathematics(6/34) Fitting Curves to Data The function polyfit finds the coefficients of the polynomial of the specified degree that best fits the data using a least squares algorithm. Temperatures one aftemnoon For example:The following would fit a polynomial of degree 2 through 70 the data points,storing the values 0 in a vector called coefs. 65 >>×=2:6 >>y=[65677271631 >coefs polyfit (x,y,2) CPHAW coefs= -1.8571 14.8571 41.6000 同停大学 TONGJI UNIVERSITY
Advanced Mathematics(6/34) Fitting Curves to Data ➢ The function polyfit finds the coefficients of the polynomial of the specified degree that best fits the data using a least squares algorithm. For example: The following would fit a polynomial of degree 2 through the data points, storing the values in a vector called coefs

Advanced Mathematics(7/34) Fitting Curves to Data This says that MATLAB has determined that the best quadratic that fits these data points is -1.8571x2+14.8571x+41.6000, Temperatures one afternoon 75 The function polyval can then be used to evaluate the polynomial e 70 at specified values. 65 For example:we could evaluate at every value in the x vector: 60 Time >curve polyval (coefs,x) curve= 同濟大学 AW 63.8857 69.457171.3143 69.4571 63.8857 TONGJI UNIVERSITY
Advanced Mathematics(7/34) Fitting Curves to Data

Advanced Mathematics(8/34) Symbolic Mathematics Symbolic mathematics means doing mathematics on symbols (not numbers!). For example:ata is 2a. The symbolic math functions are in the Symbolic Math Toolbox in MATLAB and toolboxes contain related functions. To find out about the symbolic functions,help can be used: help toolbox\symbolic 同停大学 TONGJI UNIVERSITY
Advanced Mathematics(8/34) Symbolic Mathematics Symbolic mathematics means doing mathematics on symbols (not numbers!). For example: a+a is 2a. The symbolic math functions are in the Symbolic Math Toolbox in MATLAB and toolboxes contain related functions. To find out about the symbolic functions, help can be used:

Advanced Mathematics(9/34) Symbolic Mathematics MATLAB has a type called sym for symbolic variables and expressions;these work with strings. For example:to create a symbolic variable a and perform the addition just described,first a symbolic variable would be created by passing the string a'to the sym function: >>a=sym('a')i >>a+a ans= 2*a @日济大学 TONGJI UNIVERSITY
➢ MATLAB has a type called sym for symbolic variables and expressions; these work with strings. For example: to create a symbolic variable a and perform the addition just described, first a symbolic variable would be created by passing the string ‘a’ to the sym function: Advanced Mathematics(9/34) Symbolic Mathematics
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 同济大学:《Matlab在机械设计中的应用》课程电子教案(PPT课件)Chapter 07 Sparse Arrays, Cell Arrays, and Structures.ppt
- 同济大学:《Matlab在机械设计中的应用》课程电子教案(PPT课件)Chapter 06 User-defined Functions.ppt
- 同济大学:《Matlab在机械设计中的应用》课程电子教案(PPT课件)Chapter 05 Plotting.ppt
- 同济大学:《Matlab在机械设计中的应用》课程电子教案(PPT课件)Chapter 04 Branches and Loops.ppt
- 同济大学:《Matlab在机械设计中的应用》课程电子教案(PPT课件)Chapter 03Top-down and bottom-up design.ppt
- 同济大学:《Matlab在机械设计中的应用》课程电子教案(PPT课件)Chapter 02 MATLAB Basics(负责人:陈明).ppt
- 同济大学:《Matlab在机械设计中的应用》课程电子教案(PPT课件)Chapter 01 MATLAB Programming for Mechanical Engineering(Introduction to MATLAB).ppt
- 同济大学:《Matlab在机械设计中的应用》课程教学资源(试卷习题)Final Examination(B)The First Semester(2013-2014).pdf
- 同济大学:《Matlab在机械设计中的应用》课程教学资源(试卷习题)Final Examination(A)The First Semester(2013-2014).pdf
- 运城学院:《机械原理》课程教学资源(课件讲稿)第6章 齿轮.pdf
- 运城学院:《机械原理》课程教学资源(课件讲稿)第2章 平面机构的结构分析.pdf
- 运城学院:《机械原理》课程教学资源(课件讲稿)第8章 其他常见机构.pdf
- 运城学院:《机械原理》课程教学资源(课件讲稿)第9章 机械中的摩擦与效率.pdf
- 运城学院:《机械原理》课程教学资源(课件讲稿)第5章 凸轮机构.pdf
- 运城学院:《机械原理》课程教学资源(课件讲稿)第10章 机械的平衡.pdf
- 运城学院:《机械原理》课程教学资源(课件讲稿)第7章 轮系(Gear Train).pdf
- 运城学院:《机械原理》课程教学资源(课件讲稿)第3章 平面机构的运动分析(Kinematic Analysis).pdf
- 运城学院:《机械原理》课程教学资源(课件讲稿)第4章 平面四杆机构.pdf
- 运城学院:《机械原理》课程教学资源(课件讲稿)第1章 绪论(负责人:倪娟).pdf
- 运城学院:《机械原理》课程教学资源(教案讲义)第1章 绪论(打印版).pdf
- 同济大学:《Matlab在机械设计中的应用》课程电子教案(PPT课件)Chapter 09 Probability and statistics.ppt
- 同济大学:《Matlab在机械设计中的应用》课程电子教案(PPT课件)Chapter 10 Graphical User Interface.ppt
- 同济大学:《Matlab在机械设计中的应用》课程电子教案(PPT课件)Chapter 11 Simulink.pptx
- 同济大学:《汽车构造》课程电子教案(课件讲稿)第一章 内燃机工作原理及总体构造 The Working Principles and Overall Structure of Internal Combustion Engines.pdf
- 同济大学:《汽车构造》课程电子教案(课件讲稿)第二章 机体组及曲柄连杆机构 Engine Block, Crank and Connecting Rod Mechanism.pdf
- 同济大学:《汽车构造》课程电子教案(课件讲稿)第三章 配气机构 Valve Trains(负责人:李理光).pdf
- 同济大学:《汽车构造》课程电子教案(课件讲稿)第四章 汽油机燃油供给系统 Fuel Supply System For Gasoline Engine.pdf
- 同济大学:《汽车构造》课程电子教案(课件讲稿)第六章 进气、排气及增压系统 Intake, Exhaust and Boost Systems.pdf
- 同济大学:《汽车构造》课程电子教案(课件讲稿)第五章 柴油机燃油供给系统 Fuel Supply System for Diesel Engines.pdf
- 同济大学:《汽车构造》课程电子教案(课件讲稿)第七章 发动机冷却系 Cooling System.pdf
- 同济大学:《汽车构造》课程电子教案(课件讲稿)第九章 起动系统 Starting System.pdf
- 同济大学:《汽车构造》课程电子教案(课件讲稿)第八章 发动机润滑系 Lubrication System for Automotive Engines.pdf
- 同济大学:《汽车构造》课程电子教案(课件讲稿)第十章 发动机点火系统 Engine Ignition System.pdf
- 同济大学:《汽车构造》课程电子教案(课件讲稿)第十二章 发动机有害排放物的控制系统 Control System of Harmful Emissions in Engine Exhaust.pdf
- 同济大学:《汽车构造》课程电子教案(课件讲稿)Automobile structure(Types of modern automobiles).pdf
- 同济大学:《汽车构造》课程电子教案(课件讲稿)Chapter 13 传动系统 Overview of automobile drivetrain.pdf
- 同济大学:《汽车构造》课程电子教案(课件讲稿)Chapter 14 离合器 Clutch.pdf
- 同济大学:《汽车构造》课程电子教案(课件讲稿)Chapter 15 变速箱 Transmission and transfer case.pdf
- 同济大学:《汽车构造》课程电子教案(课件讲稿)Chapter 16 自动变速器 Vehicle Automatic transmission.pdf
- 同济大学:《汽车构造》课程电子教案(课件讲稿)Chapter 17 传动装置 Universal Gearing.pdf