Plotting a complicated funtion

2 views (last 30 days)
Jon
Jon on 15 Apr 2011
The task I have to accomplish is to plot this funtion:
xi=A*z*exp(-B*(1/C+y^2)-D*y*Z)*integral between -infinity and y of: exp(B*(1/C+y^2)+D*y*z)dy
z = E*[(F*the sum between i=1 and N of: (G*integral between -infinity and +infinity of: (xi/((the sum between i=1 and N of: xi)+H)*(y/(C+y^2)^2)dy))-I]
I hope you can understand it because its hard to write it here. Its a series of equations that starts with x1 and ends with xN. N is a known number somewhere between 5 and 10. I can pretty much decide what N will be. A to I is constants and x and y is variables. z is a sequence that appears 3 times in the equation and it therefore denoted by z and written separately below the main equation.
My Matlab experience is not zero but its limited and I could really use your help since I'm not sure what to do to plot xi against y. I do realize that this will require a lot of code and I'm not asking anybody to write it all for me just to give me some hints of how to go about this task.
All help will be appreciated. /Jon

Answers (2)

Walter Roberson
Walter Roberson on 16 Apr 2011
I am not at all certain that such an expression can be constructed. Your z is defined in terms of an integral over xi, but your xi is defined in terms of z.
Your use of y as the upper bound of the first-mentioned integral is confusing when the variable of integration is y itself. Is that an ODE or a plain integral?
Your first integral, over y, has z as a term in the exp(), and z in turn has a definite integral over y, making it look like y is being defined in terms of y. However, with it being a definite integral, the result would have to be independent of y, so it would be clearer to write the y inside z as being a different (unused) variable to prevent this kind of confusion.
If you do not in fact have xi defined recursively in terms of xi, then unless z comes out undefined or as one of the infinities, then with the upper bound of the first integral being y, xi will be 0. If you change the upper bound to be Y, then the definite integral comes out to be a multiple of the difference of two erfc(), with the terms of the erfc() identical except for one of the two being in terms of y and the other being in terms of Y (the upper bound.) Let Y=y and the two terms are the same, their difference becomes 0, so the integral becomes 0. That 0 is multiplied by some constants, thus remaining 0, and is multiplied by z, so the expression would remain 0 if z is any finite real value (i.e., not undefined and not infinity.)

Jon
Jon on 16 Apr 2011
Then I must have gone about the problem the wrong way. I'm trying to plot a variable against another with the help of a series of equations from a scientific article. They managed to plot it so there should be a way. The equations are as follows:
y2 = A*(B/(B^2+y^2)
xi = y3*C*exp(-y2*D-y3*y*E)*integral between -infinity and y of:exp(y2*D+y3*y*E)dy
Bigxi = xi/(the sum between i=1 and N of:(xi) + F)
y4 = G*the sum between i=1 and N of:(-(integral between -infinity and +infinity of:Bigxi*(dy2/dy)dy))
y3 = y5*H
y5*G = I-y4*G
dy2/dy is by my calculations = -2*A*(y/(B^2+y^2)
xi, Bigxi, y, y2, y3, y4 and y5 are all independent variables. A to I are constants although different constants than in the previous post. The i in xi stand for that there are several different x. x1-xN.
The article is not very explicit and doesn't say how the did. What I'm trying to do it to plot xi as a function of y. I'm not looking for an exact analytical solution. This most likely have to be solved with numerical methods.
  8 Comments
Walter Roberson
Walter Roberson on 18 Apr 2011
I have interpreted [Sum of i to N of (xi) + F] as being [F + Sum of i from 1 to N of (xi)] as the (xi) is shown in () right after the summation sign, implying that that the summation is intended to bind more tightly than the addition. My results would not, however, have changed if I had interpreted the F as being added for every "i".
When I work systematically back through the questions, I can get as far as x[i](y) being an integral from -infinity to y for an expression that involved y4, with y4 being
sum(G*(int(2*x[i](y)*A*y/((F+sum(x[i](y), i = 1 .. N))*(B^2+y^2)), y = -infinity .. infinity)), i = 1 .. N)
The "y" there exist strictly within the integral and the bounds do not involve "y", so y4 is therefor an expression which is independent of the "current" value of y -- the "y" in the expression could be rewritten with a different free variable for clarity. Notice, though, that y4 is defined in terms of sum(x[i](y) (with i from 1 to N and y over -infinity to +infinity).
It is not possible to isolate the two variables in the expression of each other.
It is, however, possible upon examination to find values that make the expressions consistent. The expression for x[i](y) comes out identical to 0 if y4 = II/G . If this x[i](y)=0 is substituted in to the expression for y4, the right hand side comes out 0. So, if y4 = 0 = II/G, x[i](y) = 0 for all i and y. This condition can be satisfied if II is 0 -- or, I suppose, if G is infinity. Other values for II lead to expressions that are difficult to solve simultaneously.
Jon
Jon on 19 Apr 2011
Thank you for your effort. Its very nice of you to take time to help me. Today I have talked to my schools best math professor and she said that the original expression in this question is solvable if you put big numbers instead of the infinity boundary in the integrals and if you replace the y either in the boundary of the equation or in the part of the equation affected by the integral with another variable just as you have mentioned. I'm going to talk to my mentor tomorrow about this and then rewrite the equation. If I still have any Matlab related problems I will ask these in a new question.

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!