## Trapezoidal method

## Trapezoidal method

(OP)

Hello,

I am working on a program to find the value of the current in a coil. This value satisfies the following equation:

y'=sin(2t)-[(e

which is of the form y'=f(t,y)

I know that in order to solve this I need to use the trapezoidal method to solve a differential equation, the formula is:

y

I have found examples of the standard trapezoidal method but I do not think they will help because of the difference in the formulas. Can anybody give me some guidance here?

I am working on a program to find the value of the current in a coil. This value satisfies the following equation:

y'=sin(2t)-[(e

^{y}-1)/(e^{y}+1)]which is of the form y'=f(t,y)

I know that in order to solve this I need to use the trapezoidal method to solve a differential equation, the formula is:

y

_{n+1}=y_{n}+.5**h*(f(t_{n},y_{n})+f(t_{n+1},y_{n+1}) where*h*=t_{n+1}-t_{n}I have found examples of the standard trapezoidal method but I do not think they will help because of the difference in the formulas. Can anybody give me some guidance here?

## RE: Trapezoidal method

## RE: Trapezoidal method

## RE: Trapezoidal method

yn+1=yn+.5*h(f(tn,yn)+f(tn+1,yn+1)

because yn+1 appears on both sides. Assuming h is really small, why not use the Euler form of

y(n+1) = yn + h * f(tn, yn)

In that case, the same question arises: do you want all the values given a starting t0 and y0 up to a particular value of tn or do you just want it satisfying some criteria.

## RE: Trapezoidal method

http://www.tek-tips.com/viewthread.cfm?qid=1710515