1 / 31

MathCAD

MathCAD. B. A. a. b. Boundary value problem. Second order differential equation have two initial values. They can be placed in different points. for. for. a. b. Boundary value problem. Other type of initial conditions. for. for. b. A. Boundary value problem.

mina
Download Presentation

MathCAD

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MathCAD

  2. B A a b Boundary value problem • Second order differential equation have two initial values. They can be placed in different points. for for

  3. a b Boundary value problem Other type of initial conditions for for b A

  4. Boundary value problem • Applies to second order differential equations or systems of first order differential equations • Initial conditions are given on opposite boundaries of solving range • Numerical methods (usually) needs initial values focused in one point (one of the boundaries)

  5. a b Boundary value problem Initial conditions requiredto start the integrating procedure for for a

  6. Boundary value problem We have to guess missing initial condition at the point we start the calculations

  7. Boundary value problem HOW TO GUESS??!! • Assume missing initial value(s) at start point • Make the calculation to the endpoint of independent variable range. • Check the difference between boundary condition calculated and given on the endpoint • If the difference (error) is too large change the assumed values and go back to point 2.

  8. Boundary value problem Example: Given initial conditions of system of two differential equations (range <a,b>): y1a, y1b To start calculations the value of y2a is required • Assume y2a • Calculate values of y1, y2until the point b is reached • Calculate the difference (error) e= |y1b(calculated)-y1b,(given)| • If e>emax change y2aand go to p. 2

  9. Boundary value problem What is necessary to solve the boundary values problem? • System of equations • Endpoints of the range of independent variable (range boundaries) • Known starting point values • Starting point values to guess • Calculation of error of functions values on the opposite (to starting point) side of the range

  10. Boundary value problem • To find missing initial values in the MathCAD the sbval procedure can be used. SYNTAX: sbval(v, a, b, D, S, B) • a, b – endpoints of the range on which the differential equation is being evaluated (p. 2) • v – vector of guesses of searched initial values in the starting point a(p. 4) • D – vector function of independent variable and dependent variable vector, consists of right hand sides of equations. Dependent variables in the equations HAVE TO BE vector type! (p. 1) • S – vector function of starting point and vector of guesses (v) defining initial conditions on starting point(p. 3&4) • B – function (could be vector type) to calculate error on the endpoint (b) (p. 5)

  11. Boundary value problem

  12. Boundary value problem

  13. Odesolve Overall ODE solving procedure

  14. Odesolve • Returns a function(s) of independent variable which is a solution to the single ordinary differential equation or ODE system • Solving initial condition problem as well as boundary problem • Can solve single ODE and system of ODE • Result is an implicit function

  15. Odesolve • Syntax • Keyword Given • Differential equation(s) using Boolean equal(s) (bold =). Derivative symbols ` by pressing [ctrl][F7] or constructions like from calculus toolbar. • Initial/boundary condition(s) (for derivatives only ` symbols). Boolean equal. • function_name:=Odesolve([v],x,b,[initvls])

  16. Odesolve • Additional information: • v – vector of functions names for ODE system • b – terminal point of the integration • Initvls – number of discretization intervals (def. 1000) • functions have to be defined explicitly (y(x) not just y) • Algebraic constraints are accepted.

  17. Odesolve • One second order ODE

  18. Odesolve • System of two first order ODE

  19. Odesolve • Numerical methods: • Adams/BDF calls: • Adams-Bashford method for non-stiff systems of ODE • BDF method for stiff systems of ODE • Fixed – calls rkfixed • Adaptive – calls Rkadapt • Radau – calls Radau method – used with algebraic constraints

  20. MathCAD symbolic operations • Chosen symbolic operations accessible in MathCAD • Simple symbolic evaluation: algebraic expressions, derivating, integrating, matrix operations, calculation of limits etc. • Symbolic with keyword: substitute, expand, simplify, convert,parfrac, series, solve,...etc.

  21. MathCAD symbolic operations • Symbolic operation are accessible from the Symbolic Toolbar or through the keys: • [ctrl][.] simple operations • [shift][ctrl][.] operations with keywords • To get the symbolic result NO VALUE can be assigned to the variables used in expressions!!

  22. MathCAD symbolic operations • simple operations • Symbolic integration • Indefinite integration operator (symbol), expression, [ctrl]+[.] • Symbolic derivation • Derivative operator, expression, [ctrl]+[.] • Calculation of limits, sums

  23. MathCAD symbolic operations • Substitute - replace all occurrences of a variable with another variable, an expression or a number • expression [ctrl][shift][.] substitute, substitution equation (with bold = symbol) • expand - expands all powers and products of sums in the selected expression • expression [ctrl][shift][.] expand, variable • Simplify - carry out basic algebraic simplification, canceling common factors and apply trigonometric and inverse function identities • expression [ctrl][shift][.] simplify

  24. MathCAD symbolic operations • Factor – transforms an expression into a product • expression [ctrl][shift][.] factor • if the entire expression can be written as a product • To convert an equation to a partial fraction, type: • expression, [ctrl][shift][.] convert,parfrac, variable • series keyword finds Taylor series • expression, [ctrl][shift][.] series, variable = central point of expansion, order of approximation • To solve single equation • expression [ctrl][shift][.] solve, variable • Assumes expression equal 0

  25. MathCAD symbolic operations • To solve system of equation • Type Given • Type equations (using [ctrl]+[=]) • find(var1, var2,..) [ctrl][.]

  26. Units in MathCAD

  27. System of units available in MathCAD: • SI - fundamental units: meters (m), kilograms (kg), seconds (s), amps (A), Kelvin (K), candella (cd), moles (mole). • MKS - fundamental units: meters (m), kilograms (kg), seconds (sec), coulombs (coul), Kelvin (K) • CGS - fundamental units: centimeters (cm), grams (gm), seconds (sec), coulombs (coul), Kelvin (K) • US - fundamental units: feet (ft), pounds (lb), seconds (sec), coulombs (coul), Kelvin (K)

  28. To add unit: type unit after number (MathCAD will add multiplication sign between number and units) • MathCAD converts units between Units Systems and between fundamental and derived unit. User can define new derived units as fallows: derived_unit:=multiplier*fundamental_unit, e.g.:kPa:=1000*Pa

  29. Independently of units used in data the results are given in fundamental units of actual Units System. • Result unit can be changed!! • After the result of evaluation the placeholder appears. In these placeholder type the desired unit

  30. Calculations with units. Calculate volume of rectangular prism of size ft

  31. Units problem • Parameters with units can not be used in the vector function definition of system of differential equations (especially from transformation of second order ODE to the system of first order ODE) • Solution: • Multiply each element of sum in vector function definition by inversion of its unit

More Related