chapter5.page02

chapter5.page02 - list enclose by () after function name,...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
2 1. NUMERICAL METHODS FOR ORDINARY DIFFERENTIAL EQUATIONS while loop: Typically used when unknown number of steps need to be carried out. You can break a while loop with a break statement or a return statement. if – else(otherwise): Used when condition(s) must meet be- fore carrying out some steps. The else(otherwise) provide al- ternative steps if any. 1.2. Programming in Mathcad. To translate a numerical al- gorithm into a program in Mathcad , you need to define a function name with function arguments and function body. The function name can be any sequence of alphabetic letter begin with an English letter, such any ”myFunction”, ”Myfunction1” etc. The function ar- guments specify the input to the function, typically the items specified in the input statement of an algorithm and is an comma(,) separated
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: list enclose by () after function name, such as myFunction(f, a, N, tol), myOne(a,b). Notice the function argument is optional, you can dene a function with out argument as myFunction(). The function body implements the step section of an algorithm and the output statement. In Mathcad the function body is on the right side of := with vertical bars as grouping symbol. The entire function body is considered as a group, inside, it might has many subgroups. For the algorithm of nding f ( x ) = 0, there is an subgroup that contains step three and four, as shown in the following screen shot, the screen shot also shows how to get the programming toolbar from the math toolbar. Figure 1. mySolver and Programming toolbar...
View Full Document

Ask a homework question - tutors are online