0
$\begingroup$

$x'' - tx' + x^2 = t$

$x(0) = 1$

$x'(0) = 1$

a) Restate the problem solving a system of first-order ODEs.

$x_1' = x_2$

$x_2' = t-x_1^2+tx_2$

$x_1(0) = 1$

$x_2(0) = 1$

b) Use part a) and Euler's method with h = 0.1 to find x(0.2).

$x(0.1) = 1 + (0.1)(0-1+0) = 0.9$

Is my work up to this point correct? I'm unsure whether this should actually be two equations.

  • 0
    Let $\hat{x}(t) = \begin{bmatrix} x_1(t) \\ x_2(t) \end{bmatrix}$. Write the first-order differential equation that $\hat{x}$ satisfies (you've basically done this already), and then use Euler's method to estimate $\hat{x}(.1)$ and $\hat{x}(.2)$. In other words, use Euler's method to estimate both $x_1$ and $x_2$.2012-11-12

2 Answers 2

1

Your part a) is correct, but for part b) remember that you've made $x_1=x$. Thus finding an approximate value for $x(0.2)$ is equivalent to finding an approximate value for $x_1(0.2)$, which you would find using the first of your two equations (looks like you've used the second one).

With the first equation, we use Euler's method to obtain the approximation $x_1(0.2)\approx x_1(0.1)+0.1\cdot x_2(0.1)$. We don't have $x_1(0.1)$ and $x_2(0.1)$ yet, we need to approximate them using Euler's method. Using the first equation, $x_1(0.1)\approx x_1(0)+0.1\cdot x_2(0)=1.1$. Using the second equation, $x_2(0.1)\approx x_2(0)+0.1\cdot (0-x_1(0)^2+0)=0.9$. Thus finally, $$x_1(0.2)\approx 1.1+0.1\cdot 0.9=1.19$$

  • 0
    The solutions says that the initial conditions are $x_1(0) = 0$ and $x_2(0) = 1$. Is this incorrect?2012-11-12
  • 0
    That doesn't correspond to $x(0)=1$ and $x^\prime(0)=1$, which is what you have above. Since $x_1=x$, $x_1(0)$ should be 1 as well. $x_2=x_1^\prime=x^\prime$, so $x_2(0)=1$ is correct.2012-11-12
  • 0
    Fair enough. So the second equation isn't used for anything- the $x_2'$?2012-11-12
  • 0
    You need to update both $x_1$ and $x_2$, and the $x_2'$ equation is used to update $x_2$.2012-11-12
  • 1
    So when it says find $x(0.2)$ I really need to find $x_1(0.2)$ and $x_2(0.2)$, correct?2012-11-12
  • 0
    @littleO is correct, since you'll be writing $x_1(0.2)=x_1(0.1)+0.1x_2(0.1)$, you'll need to use the second equation to approximate $x_2(0.1)$. You can approximate $x_1(0.1)$ using the first equation. Since $h=0.1$ you can't jump straight to 0.2.2012-11-12
  • 0
    So $x_2(0.2) = x_2(0.1)+h*[x_2'(x_1(0.1), x_2(0.1))]$?2012-11-12
  • 0
    I'm not sure what you mean by $x_2^\prime(x_1(0.1),x_2(0.1))$. The first slot should always be a time. Also, you don't need to find $x_2(0.2)$, just $x_1(0.2)$. I'll edit my answer to show the steps.2012-11-12
  • 0
    OK, I think I got it. I'm just not sure why I don't have to solve $x_2$, can you explain that?2012-11-12
  • 0
    You can estimate $x_2(.2)$ if you like, but this problem only asked for $x(.2) = x_1(.2)$. (In order to get $x_1(.2)$, you're going to need estimates of $x_1(.1)$ and $x_2(.1)$.)2012-11-12
0

Let $\hat{x}(t) = \begin{bmatrix} x_1(t) \\ x_2(t) \end{bmatrix}$. Then $\hat{x}$ satisfies \begin{equation} \hat{x}'(t) = f(t,\hat{x}(t)) \end{equation} for an appropriate function $f:\mathbb{R}^2 \to \mathbb{R}^2$. Now use Euler's method to estimate $\hat{x}(.1)$ and $\hat{x}(.2)$.

For example, \begin{equation} \hat{x}(.1) \approx \hat{x}(0) + .1 f(0,\hat{x}(0)). \end{equation}