12.07.2015 Views

Learning Guide Learning Guide

Learning Guide Learning Guide

Learning Guide Learning Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.1 Simple solve • 5186113 , −22013The assign CommandThe assign command also allocates values to unknowns. For example,instead of defining x, y, and z as functions, assign each to the expressionon the right-hand side of the corresponding equation.> assign( s2 );> x, y, z;− 52713 − 7 t − 28 635 70u, + 12 t + u, −7013 13 13 13 − 7 t − 5913 uThink of the assign command as turning the “=” signs in the solutionset into “:=” signs.The assign command is convenient if you want to assign expressionsto names. Remember, though, that while this command is useful forquickly assigning solutions, it cannot create functions.This next example incorporates solving differential equations, whichsection 3.6 discusses in further detail. To begin, assign the solution.> s3 := dsolve( {diff(f(x),x)=6*x^2+1, f(0)=0}, {f(x)} );s3 := f(x) = 2 x 3 + x> assign( s3 );However, you have yet to create a function.> f(x);2 x 3 + xproduces the expected answer, but despite appearances, f(x) is simplya name for the expression 2x 3 + x and not a function. Call the functionf using an argument other than x.> f(1);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!