mathcad 14 tutorials

22 août 2010

Documenting Mathcad Components

mathcad 14 tutorials  cheap mathcad 14


Sometimes some calculations are implemented as basic  code. Mathcad is a useful tool to translate and analyze the behavior of  these calculations. The objective of this worksheet is to show how to  implement a simple but traceable component for using basic language  inside Mathcad.


The component (or control) of interest, is the Text Box component. You can find the help about controls under QuickSheets > Programming.

The Controls can be found under the Insert menu as shown.

Use the contextual menu, to access the Component Properties and the script code.

Contextual Menu

Setting up Control Properties


For example, this component

does this computation:

The Component Internal Code

This schema is useful for developing purposes, but the final work looks undocumented. To show what code is executed, insert a Text Box named Editor with this internal code


With the ExecuteGlobal statement you can use the control text as the program. Here is the result:

Documented Component


Application Example

A VBScript Runge-Kutta Solver

This example is Runge-Kutta solver writing in  VBScript. Notice that the code inside the Class declaration generates an  error in the Sub EditorEvent_Start, because the class name can't be  repeated. Then, if you modify this part of the code, you also need to  'modify'  the internal script (selecting Edit Script from contextual  menu, and exiting) to tell Mathcad that something has happened.


ODE, y' = d(x,y)

script notation

Mathcad notation

Initial Conditions

Endpoint and Intervals


Odesolve solution

Script solution


Comparison of results




Inside the Text Box Copy and Paste are called with [Ctrl] [Shift] C and [Ctrl] [Shift] V respectively.

Posté par oldforce à 03:34 - Commentaires [0] - Permalien [#]