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^{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?

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?

ShoxPhysics wrote: |
---|

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 believe it's supposed to be: (check parenthesis)

y

A good explanation of what you want is at http://www.swarthmore.edu/NatSci/echeeve1/Ref/NumericInt/RK2.html

You start with an initial condition y_{0} at t_{0}, and you want to find all y_{n} at t_{n}=t_{0}+n*h (you calculate y on a regular grid)

1. Create a temporary value for y_{1}, as y_{1,temp}=y_{0}+h*f(t_{0},y_{0})

2. Calculate the value at t_{1} as y_{1}=y_{0}+0.5*h*(f(t_{0},y_{0})+f(t_{1,temp},y_{1,temp}))

Now you have y_{1}. Repeat the same procedure to calculate y_{2} and so on

You start with an initial condition y

1. Create a temporary value for y

2. Calculate the value at t

Now you have y

Topic archived. No new replies allowed.