cse 131 crib sheet - % means DIFFERTIAL OF V with respect...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 131 Midterm Crib Sheet create a numerical scalar w, then create a symbolic version w = 6 / 9 % note rounding for numerical display wSym = sym(w) % symbolic version avoids rounding error create a symbolic constant for G in universal graivation G = sym(6.672 * 10^-11) % in CGS units covert the symbolic value of G to a numerical value g = double(G) ezplot with bounds ezplot(y, [.5,1]) set up numerical values for A B and C, and substittue into x1 a = 3 b = 10 c = 1 x1_numerical = subs(x1, {A,B,C}, {a,b,c}) % notice the 'curly brackets' use finserve to find the inverse function (if there is one) x = cos(theta) xInv = finverse(x) using solve to solve equations of 2 unknowns clear, syms x y b ellipse1 = x^2 + y^2/b^2 -1 ellipse2 = x^2/100 + 4*y^2 – 1 intPts = solve(ellipse1, ellipse2, x, y) intPts_x = intPts.x intPts_y = intPts.y Definate Integral intF_overX = int(F,x, 0,1) Using dsolve is not hard. There are just a couple of things to keep straight for the mechanics of use. % 1) The CAPITAL-D is used for the DIFFERENTIAL. So below, the term Dv
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % means DIFFERTIAL OF V with respect to the t: dV/dt. % 2) The first argument to dsolve is THE DIFFERENTIAL EQUATION itself, % and it is enclosed in single quotes. % 3) The second argument to dsolve is THE INITIAL CONDITION, again set % off in single quotes. % 4) The third argument is the variable with which the differential is % with respect to, again set off in single quotes. E = dsolve('10*Dv = -9.8*10', 'v(0)=100', 't') % The 10 is the assumed mass. % The only thing beyond what you did for first order Diff EQs that is new % for using the symbolic toolbox for second order Diff EQs is the use of % CAPITAL-D-2. This tells MATLAB that you are using a SECOND DERIVATIVE. % Notice too that the initial condition on velocity is written a a % CAPITAL-D. Notice finally that the variable you identify as the target % is the LAST argument, in the second order examples, it is the fourth % argument. E = dsolve('10*D2x = -9.8*10', 'x(0)=0', 'Dx(0)=100', 't')...
View Full Document

This note was uploaded on 03/31/2008 for the course CSE 131 taught by Professor Sticklen during the Fall '08 term at Michigan State University.

Ask a homework question - tutors are online