Plotting a complicated funtion
2 views (last 30 days)
Show older comments
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
0 Comments
Answers (2)
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.)
0 Comments
Jon
on 16 Apr 2011
8 Comments
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.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!