Добавил:
kostikboritski@gmail.com Выполнение курсовых, РГР технических предметов Механического факультета. Так же чертежи по инженерной графике для МФ, УПП. Писать на почту. Дипломы по кафедре Вагоны Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
41
Добавлен:
12.08.2017
Размер:
2.3 Mб
Скачать

144 / Chapter 13 Symbolic Calculation

Live Symbolic Evaluation

One advantage to using the symbolic equal sign, sometimes together with keywords and modifiers, is that it is “live,” just like numeric processing in Mathcad. That is, Mathcad first checks all the variables and functions making up the expression being evaluated to see if they’ve been defined earlier in the worksheet. Then the expression is evaluated symbolically. Whenever you make a change to the worksheet, the results automatically update. This is useful when the symbolic and numeric equations in the worksheet are tied together.

Unlike the equal sign, which always gives a numeric result, the symbolic equal sign is capable of returning expressions. You can use it to symbolically evaluate expressions, variables, functions, or programs.

To use the symbolic equal sign:

1.Enter the expression you want to evaluate.

2.Click on the Symbolic toolbar or press [Ctrl] [.] (period) to get the symbolic equal sign, “.”

3.Press [Enter]. Mathcad displays a simplified version of the original expression. If an expression cannot be simplified further, Mathcad simply repeats it to the right of the symbolic equal sign.

The symbolic equal sign is a live operator just like any Mathcad operator. When you make a change anywhere above or to the left of it, Mathcad updates the result. Figure 13-2 shows some examples of how to use the symbolic equal sign, “.” You can force the symbolic equal sign to ignore prior definitions of functions and variables by defining them recursively just before you evaluate them, as shown in Figure 13-5 on page 148.

Note The symbolic equal sign, “,” applies to an entire expression. You cannot use the symbolic equal sign to transform only part of an expression.

Using Keywords

The “” takes the left-hand side and places a simplified version of it on the right-hand side. You can control how the “” transforms the expression by using one of the symbolic keywords.

Live Symbolic Evaluation / 145

Figure 13-2: The symbolic equal sign uses previous definitions. If the expression cannot be simplified further, the symbolic equal sign does nothing. When decimals are used, the symbolic equal sign returns decimal approximations.

To do so:

1.Enter the expression you want to evaluate.

2.Press [Ctrl] [Shift] [.] (period).

3.Click on the placeholder to the left of the symbolic equal sign and type any of the keywords from the Symbolic toolbar. If the keyword requires any additional arguments, separate the arguments from the keyword with commas.

4. Press [Enter].

You can also first enter the expression you want to evaluate. Then click on a keyword from the Symbolic toolbar to insert the keyword, placeholders for any additional arguments, and the symbolic equal sign, “.” Finally press [Enter] for the result.

Online Help Online Help lists and describes all the symbolic keywords available from the Symbolic and Modifier toolbars.

Many of the keywords take additional arguments, such as the name of a variable with respect to which you are performing the symbolic operation. Some of the arguments are optional. See Figure 13-3 for an example.

Note Keywords are case sensitive so they must be typed exactly as shown. Unlike variables, however, they are not font sensitive.

146 / Chapter 13 Symbolic Calculation

Figure 13-3: By itself the symbolic equal sign simply evaluates the expression, but when preceded by an appropriate keyword, the symbolic equal sign can change its meaning. Note that the keyword float makes the result display as a floating point number if possible. The keyword laplace returns the Laplace transform of a function.

Using Arguments with Keywords

Many keywords take additional arguments that control the operations performed by the keyword. For example, the keyword series returns the Taylor series of a function. By default, series returns the terms of the series of order less than 6, which means

that the highest power of x that is displayed is x5. You can change the number of terms returned by adding arguments after series.

For example, to return the terms of the Taylor series for ex of order less than 3:

1.Type ex. (Press [Shift] 6 to create a placeholder for the exponent x.)

2. Press [Ctrl] [Shift] [.] (period).

3.Type “series” in the placeholder, followed by a comma.

4.Type x in the placeholder, to specify the variable, followed by a comma.

5.Type 3 in the placeholder to return only the terms of order less than 3.

6. Press [Enter].

Using More Than One Keyword

You can apply several symbolic keywords to a single expression by two different methods.

Live Symbolic Evaluation / 147

To apply several keywords and see the results from each:

1.Enter the expression you want to evaluate, followed by the first keyword and any comma-delimited arguments for the keyword. See “Using Arguments with Keywords” on page 146.

2. Press [Enter] for the first result.

3.Click on the result and press

[Ctrl] [Shift] [.] again. The first result disappears temporarily. Enter a second keyword and arguments into the placeholder.

4.Press [Enter] for the second result.

Continue applying keywords to the intermediate results.

To apply several keywords and only see the final result:

1. Enter the expression you want to evaluate.

2. Press [Ctrl] [Shift] [.] (period).

3.Enter the first keyword into the placeholder, including any comma-delimited arguments.

4.Press [Ctrl] [Shift] [.] again and enter a second keyword into the placeholder. The second keyword is placed immediately below the first keyword.

5.Continue adding keywords by pressing [Ctrl] [Shift] [.] after each one. Press [Enter] for the final result.

Keyword Modifiers

Keyword modifiers are special words that control the behavior of keywords. For example, you can use the modifier “real” after the keyword assume to make Mathcad assume that a variable as a real number. The following example shows how to simplify an expression, using the simplify keyword, assuming that a variable is real:

1.Type an expression containing the variable you want to assume is real.

2. Select simplify from the Symbolic toolbar.

3.Press [Ctrl] [Shift] [.] (period) to insert a placeholder below simplify.

Соседние файлы в папке doc