Difficult integration question

  • Thread starter Thread starter Ry122
  • Start date Start date
  • Tags Tags
    Integration
Ry122
Messages
563
Reaction score
2
I have the set of equations
dx/dt =(1 - y)x and dy/dt =(x - 1)y
And the initial conditions x(0)= 0.5 and y(0) = 0.5
I need to integrate numerically from t = 0 to t = 10 with a stepsize of t = 0.4.

So i need to take small time intervals of 0.4 and find the area occupied beneath the graph at those points and sum all of these areas together to find the total area under the graph from t = 0 to t = 10.

The problem is that I don't know how to specify the time interval to the function in a situation like this where f'(t) doesn't have a 't' that i can substitute 0.4, 0.8, 0.12 etc into.

Can someone tell me how this can be done?
Is it correct to say that
f'(t) = (1-y)x, (x-1)y
If so, would changing (1-y)x to the value of t perhaps be the correct method of doing this since it represents the value of the x-axis and therefore t?
 
Physics news on Phys.org
If you combine the equations you obtain

\frac{y}{1-y} dy = \left(1-\frac{1}{x}\right) dx

This can be integrated to find a relationship between x and y that might be helpful. You'd end up with an equation for x and another for y. You need to be careful to stay away from regions where this formula has singularities.
 
Do you know how I could use that relationship to help me find the integral numerically?
 
Ry122 said:
Do you know how I could use that relationship to help me find the integral numerically?

Like I said you can use it to obtain decoupled equations for x' and y'. As for the numerical methods, I'd assume you want to read up on finite difference equations.
 
What if I solve each of the equations numerically on their own, and find a solution for both of them? What would the next step be?
 
They say you, at a certain point x, y, the rate of change of x versus time is (1-y)x. So , where do I start my path ? In (0.5, 0.5). How much is there the rate of change of x ? 0.5^2=0.25. So where will be my next point in my path ? Answer 0.5+0.25, next Y. Now do the similar to get next y.

To calculate the Area you should know the area of what. This is not stated.
 
I tried to integrate this using euler's method which is very simple.
It's just ynext = ycurrent + y'*h
The solution I got was very close to the actual solution up to a certain point. In the actual solution, it gradually increased from the initial condition of 0.5 and once the y value of 2.153 was reached it began to decrease.
In my numerical approximation it didn't stop increasing once it reached 2.153 and continued to increase.
Does someone know what I might be doing wrong?
 
Last edited:
Back
Top