0

Finding solution of differential equation using euler numerical method $\displaystyle \frac{dy}{dx}=0.3y-10$ and $0\leq x\leq 3$ and $x=0,y=40.$

What i have tried

$\displaystyle y_{n}=y_{n-1}+h\cdot f(x_{n-1},y_{n-1})$.

Where $f(x,y)=0.3y-10.$

I have a doubt that what should i take width interval $h$ in above question.(which is not mention here)

Can anyone please explain me what i take value of $h$. Thanks

jacky
  • 5,194
  • Are you really given no hints on how to subdivide the interval? No mention of "$10$ segments" or "$x_n=n$" or the like? Then to be on the safe side do 3 calculations with step sizes $h=1, 0.5, 0.25$, these should already show the first order nature of the method. – Lutz Lehmann Apr 17 '20 at 06:56

2 Answers2

1

You just wrote the euler algorithm. Notice that $f(x_n, y_n) = 0.3 y_n - 10$. Thus,

$$ y_n = y_{n-1} + h (0.3 y_{n-1}- 10) = (1+0.3h) y_{n-1} - 10 h $$

Now, since you are not given $h$, you may pick for instance $h=1$, for simplicity. Then, you have an algorithm:

$$ \begin{cases} y_n = 1.3 y_{n-1} - 10 \\ x_0 = 0 \\ y_0 = 40 \end{cases} $$

James
  • 3,997
1

You can start with some large $h_0$, for instance $h_0 = \frac{1}{10}$, and then halve $h$ until the difference between numerical solutions in common grid points is below some tolerance $\varepsilon$.

PierreCarre
  • 20,974
  • 1
  • 18
  • 34