This preview shows pages 1–7. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Symbolic Computations CSC 113 Fall 2010 Conventional Computations Matlab was designed to execute serial computations: value = expression; For example, suppose we have D = D e Q / RT If we know the values on the righthand side, we can calculate D : >> D0 = 25; >> Q = 1.6e 19; >> R = 10; >> T = 273; >> D = D0 * exp (Q /( R*T )); What if instead we know everything except T ? On paper, we could proceed as follows: D = D e Q / RT ln ( D ) = ln ( D ) Q RT ln D D = Q RT T = Q R ln ( D / D ) Can we coerce Matlab into solving for one variable in terms of the others? This is the purpose of symbolic computation (requires the symbolic toolbox, which uses Maple). What if instead we know everything except T ? On paper, we could proceed as follows: D = D e Q / RT ln ( D ) = ln ( D ) Q RT ln D D = Q RT T = Q R ln ( D / D ) Can we coerce Matlab into solving for one variable in terms of the others? This is the purpose of symbolic computation (requires the symbolic toolbox, which uses Maple). Symbolic Variables Symbolic variables look like strings, but can be manipulated according to standard rules of algebra. To define a symbolic variable, use either sym('expression') or syms variables . Examples: >> syms x >> y = 2*( x +3)^2/( x ^2+6* x +9) Alternatively, >> y = sym ( '2*( x +3)^2/( x ^2+6* x +9) ') This does not assign values to x or y , but rather assigns their functional dependence . Lets return to the earlier equation: D = D e Q...
View Full
Document
 Fall '10
 PhillipRegali

Click to edit the document details