[关闭]
@74849b 2016-10-04T11:24:20.000000Z 字数 2775 阅读 869

exercise 04

一.摘要

Many problems encountered in physics involve ordinary differential equations.First,we should learn to solve a problem involving a first-order differential equation with initial limits.

二.背景介绍

To solve first-order differential problems,there is the Euler method which is based on Taylor expansion:


where is the value of our function at .If we take x to be small,then it is usually a good approximation to simply ignore the terms that involve second and higher powers of x,leaving us with:

For problem 1.5,it dives us two relevant and which are characterised by two first-order differential equations.We can raplace with former equation,so,

with same principle,we can conclude :

This approximation forms the basis for a numerical solution of our radioactive decay problem. is the time constant.Given that we know the value of and at some value of t,we can use this to estimate its value a time t later.
In this pronlem,we are given the initial value of the function,that is,the value at time t=0.We can then employ value at t=t.This result can be used in turn to estimate the value at t=2t,3t,etc.,and thereby lead to an approximate solution and at times t where n is an integer.We delete the error term of order ,and cannot emphasize too strongly that the numerical"solution"obtained in this way is only an approximation to the"true",or exact,solution.we want to make the difference between the two negligible.

三.正文

1.calculate results for different initial conditions

code

此处输入图片的描述

此处输入图片的描述

I choose three different initial conditions,the results are as followings:

for :

此处输入图片的描述

此处输入图片的描述

for :

此处输入图片的描述

for :

此处输入图片的描述

2.test my program

code

此处输入图片的描述

Before the program's calculation,I calculate the differential equation through the pen.I draw the following results:



where .Compare the figure in terms of above-mentioned equations with the figure that is plotted through Euler method.This is my result:

此处输入图片的描述

By comparison,the two figures are similar to each other as a whole.It proves that the Euler method is very reliable within the allowed error range.

3.Always check that my program gives the same answer for different"step sizes."

code

此处输入图片的描述

Change the step size and compare their differences:

此处输入图片的描述

From the figures,we feel the results are normal and we can accept it.

四.结论

The Euler method can apply first-order differential equations and its results are in acceptable range.In this problem, and are constant finally when the system reachs equilibrium.In such a steady state,the time derivatives and should vanish.

This assignment is an original works.

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注