1 / 5

Ma 375 - Communicating Mathematics

Ma 375 - Communicating Mathematics. Carl Eberhart and Paul Eakin. Class 14 More polynomials, plus procedures. We are going to spend the day investigating the remainder question posed last time. While we are at it we will learn how to add to the Maple vocabulary by

kuper
Download Presentation

Ma 375 - Communicating Mathematics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Ma 375 - Communicating Mathematics Carl Eberhart and Paul Eakin Class 14 More polynomials, plus procedures

  2. We are going to spend the day investigating the remainder question posed last time. While we are at it we will learn how to add to the Maple vocabulary by defining new words in a worksheet.

  3. To define a new word in a Maple worksheet : 1. Name the inputs and give them values. 2. Develop the procedure in one or more input cells using the input values you have chosen. 3. Copy the appropriate input cells into a new cell. 4. At the top of this cell, add a ‘proc line’, where you name the procedure, and show the inputs. 5. At the bottom of the cell, add a line with the word end; on it. 6. Execute the cell. If everything is ok, your definition will appear nicely formatted at the bottom. 7. Test your definition out on some values you know.

  4. A couple of words, er, procedures 1. basic functions f := x -> sin(x^2+1); now f(4) returns sin(5) 2. A procedure to compute the nth term of the fibonaci sequence. fibo := proc(n) if n = 1 or n=2 then 1 else fibo(n-1)+fibo(n-2) fi end;now fibo(10) returns 55

  5. Vocabulary building for j from 1 to 10 do print(j^2+sin(j)) od; seq(j^2 + sin(j),j=1..10); evalf(sin(10)); if a > 0 then a^3 else a^5 fi; lists vs expression sequences vs sets

More Related