Lea Math Cad
Lea Math Cad
html
file:///E|/doc/mathcad/learn mathcad.html
Mathcad can handle units. For example, F = ma using m = 75 kg and a = 100 m s-2 would look like mass, :, 75, * kg; acc, :, 100, *, m/s^2; F, :, mass, *, acc; F, =.
file:///E|/doc/mathcad/learn mathcad.html
3) Differential Calculus To evaluate a derivative be sure to use the derivative operator from the Calculus Toolbar. To evaluate symbolically, use the right arrow from the Evaluation Toolbar. Let's take the derivative of x3 - 2xy with respect to x. Enter d/dx from Calculus toolbar, x, (, x^3, spacebar, -, 2, *, x, *, y, ), spacebar, right arrow from Evaluation toolbar and then click outside the equation area.
Let's take the derivative of x3 - 2xy with respect to x and evaluate it at x = 3 and y = 4. Enter x, :, 3; y, :, 4; result, :, d/dx from Calculus toolbar, x, (, x^3, spacebar, -, 2, *, x, *, y, ); result, =.
file:///E|/doc/mathcad/learn mathcad.html
4) Integral Calculus To evaluate an integral use the integral operator from the Calculus Toolbar. To evaluate symbolically, use the arrow from the Evaluation Toolbar. Let's evaluate the definite integral of exp(-x2) from 0 to infinity. Enter the definite integral operator from the Calculus Toolbar; 0, infinity, ex from the Calculator Toolbar, -x^2, x, spacebar, right arrow from the Evaluation Toolbar and click outside the equation area.
Let's evaluate the definite integral of 1/x from a to b. Enter the definite integral operator from the Calculus Toolbar; a, b, 1/x, x, spacebar, right arrow from the Evaluation Toolbar and click outside the equation area.
file:///E|/doc/mathcad/learn mathcad.html
5) Plotting Mathcad has fairly powerful graphing capabilities. If desired, data can be copied and pasted to Axum (the MathSoft graphing package) or other graphing packages or to spreadsheets. Illustrated in the examples that follow will only be simply 2-D graphs with minimal enhancements. Let's plot the fraction of Cu2+ ion in the various forms of copper-ammine complexes as a function of the logarithm of the ammonia concentration. To plot more than one variable on an axis, separate the variables with a comma.
Notation used: = association constant pCL = logarithm of the ligand concentration, concentration is 10 raised to the pCL power L = ligand, in this case NH3 Cu = copper +2 ion in all forms
file:///E|/doc/mathcad/learn mathcad.html
file:///E|/doc/mathcad/learn mathcad.html
6) Elementary Statistics A simple example to show calculation of average and confidence limit (interval) for the mean at the 95% probability limit. To enter data in a table, use Insert Table icon. The table appears like a spreadsheet (if you are familiar with one). Type in the numbers, use arrow keys to move vertically or horizontally. Resize using little black squares. All numbers do not need to appear on the screen.
To determine the number of data you can count the number of values, look at the numbers in the data table, or use the following:
file:///E|/doc/mathcad/learn mathcad.html (7 of 20) [6/8/2008 4:28:38 PM]
file:///E|/doc/mathcad/learn mathcad.html
Calculate the average (mean) of the data using the "mean" function.
Calculate the confidence limit using the "sample estimate of the standard deviation" function.
Be sure to use the capital Stddev function because this uses the N-1 term for the limited sample size. The negative sign means nothing--a confidence limit is a measure of random error which is +/-.
7) Random Error Propagation This is a simple worksheet to illustrate the propagation of random error (estimating error in a calculated result from errors in factors used in the calculation) for experimental heat capacity ratio Cp/Cv data using an irreversible isobaric expansion method. Note that the square brackets are entered just as a set of ( ) and automatically change as new ( ) are added to the expression. To wrap the equation use CTRL and ENTER. Data
Calculations
file:///E|/doc/mathcad/learn mathcad.html
% Difference
8) Linear Regression A linear regression (least squares) for experimental viscosity data for methanol, ethanol, n-propanol, and nbutanol. Note that everything is done in terms of x and y which means that it is recyclable.
Calculations
file:///E|/doc/mathcad/learn mathcad.html
Determine the intercept and slope of the straight line (y = mx + b) using Mathcad functions.
The calculations of the 95% confidence limits for the slope and intercept are a little complicated, but need to be done so that the random error can be propagated in error analysis. The range for i is created by typing 0, ;, and N-1. Note that the default setting for a running index in Mathcad is 0 to a maximum value.
The operator for the summation over i can be found on the Calculus toolbar. The array subscript and vectorize can be found on the Matrix toolbar.
file:///E|/doc/mathcad/learn mathcad.html
It is always a good thing to check the math results graphically by plotting the experimental data (as points) and the least squares line (as a line).
file:///E|/doc/mathcad/learn mathcad.html
9) Root of Equation Let's look at finding the root of an equation (in this case one that I cannot solve algebraically) using a numerical method beginning with a "seed" value. The value of fratio below is defined in terms of the partial presssures of the gases for the diffusion of He into CO2 by measuring partial pressures of the gases. The time of the diffusion is t and the length of the diffusion cell is L.
The equation being solved must be rearranged so that it is equal to zero and Mathcad will find the root such that the function y(D), in this case, is zero.
file:///E|/doc/mathcad/learn mathcad.html
The solution for D is found using the "root" function. The last two numbers are the lower and upper bounds for D.
Let's look at another example of finding roots of equations and plotting functions. These data represent freezing points of various naphthalene/diphenylamine mixtures. Data
file:///E|/doc/mathcad/learn mathcad.html
Calculations The mole fractions can be calculated. If the values of the mole fraction are requested to be displayed, they will appear in matrix form.
The freezing point change is related to concentration by the Clapeyron equation. Using data points 1 and 2 and data points 7 and 8, the two enthalpies of fusion can be determined. The "seed" guess of x = 20 is just a typical value for organic solids.
file:///E|/doc/mathcad/learn mathcad.html
At the eutectic point, the mole fraction and temperature from both Clapeyron equations will be equal. The guess of the mole fraction of 0.5 is just a value somewhere in the middle. The limits of 0 and 1 represent the minimum and maximum mole fractions, respectively.
At this point "theoretical" functions can be defined based on the Clapeyron equations and the constants determined above.
file:///E|/doc/mathcad/learn mathcad.html
Then, finally, the plot is generated. The extra labels are just text fields dropped on the graph. Some adjustments in the ranges of the axes need to be done by hand.
liquid (N + D)
solid (N + D)
file:///E|/doc/mathcad/learn mathcad.html
Mathcad is capable of handling 600 simultaneous equations (linear and nonlinear). Solving these three simultaneous equations by hand took a colleague of mine several hours and more than one try. We will use a "Solve Block" to solve these three equations dealing with the vibrational frequencies and bond force constants in the Raman spectra of benzene and deuterated benzene. A solve block consists of 1) "seed" guesses, 2) the word "Given" (not as a text field), 3) the equations (using the CRTL and =), and 4) asking for the solution. The "factor" is just a bunch of constants lumped together and the "seed" guesses are typical force constants for double bonds.
Data
Calculations
file:///E|/doc/mathcad/learn mathcad.html
11) Solving Differential Equations Mathcad can solve differential equations (including "stiff" ones) using various approaches. In this example we will look solving the simultaneous differential equations describing the kinetics of three consecutive first order reactions: A --> B --> C.
To see if the equations have been solved, let's calculate the number of atoms at time = 1 and at time = 2.
file:///E|/doc/mathcad/learn mathcad.html
12) 3-D Plots Suppose we wanted to plot the function T(x,y) = sin(2x)+cos(y). First of all define the function by typing T,(,x,,,y,),:, sin,(,2,*,x,),+,cos,(,y,).
Move the cursor into the space below and click, Choose the surface plot icon on the Graph tool pallet. Simply type T in the small black square placeholder and click outside the graph area to generate the plot.
To make the graph appear more like a surface, double click the plot to open the dialog box. On the Appearance tab, click the fill surface and colormap entries to generate a nice plot. The plot may be rotated by clicking once on the graph and then clicking and dragging with the cursor.
file:///E|/doc/mathcad/learn mathcad.html
Following the procedure from Atkins' Explorations cd, we can plot the dx2-y2 orbital. We set the number of points, define the angles, write down the normalization constant, and define the angular wave function.