| |
Solving Initial Value Problems with Mathematica's Solver
(continued from last page...)
You should have found that the problem didn't give Mathematica any
trouble. In fact, your session should have looked a little like this:
DSolve[{y'[x]==2x,y[0]==5},y[x],x]
{{y[x] → 5 + x2}}
If you didn't get the the above result, it might pay you to take a
look at the following:
Note: Here's a useful trick to overcome an error that plagues at least
half of my student's when they first start working with Mathematica. It's
easy to accidently use a single equals sign instead of a double
when entering an equation. Say you accidently type y'[2]=8 when
you should have typed y'[2]==8 as the initial condition for a
differential equation. This is a worse problem than it might seem. You could go
and change the entry, but that's not the end of it! Your earlier entry has told
Mathematica that y'[2] is to be replaced by 8. This
means that your correction, when you enter y'[x]==8, is actually
read as 8==8, a true statement, but not a useful one. The fix,
thankfully, is easy. To remove an assignment to y'[2] we simply
type y'[2]=. (Yes, the period is part of the command.)
If you think that you might have made the infamous "single equals"
mistake then go back to Mathematica now and fix the problem using the
above hint.
Moving on...
 |
If you're lost, impatient, want an overview of this laboratory assignment, or
maybe even all three, you can click on the compass button on the left to
go to the table of contents for this laboratory assignment.
|
|
|