somestudent

20 Reputation

3 Badges

1 years, 217 days

MaplePrimes Activity


These are replies submitted by somestudent

@acer 

Hello, 

all of them in the range of +- 5

@mmcdara 

Thanks for your response. You're right, that extracting the poles could be done in a more generall fashion. I tried to give you a minimal working example, therefore I added the real complex function later.

Still, I think I did not expressed my problem sufficiently. It is not about finding a maximum when the variables w,x, and y are known. Therefore, I did not put in these, I thought the maximize() function will treat unkown variables as constants, so I could use the solution of maximize() to build the constraint that the maxima are smaller than the threshold.

What I want to do is to maximize simplefunction, under the constraint, that complex function between 0 and 0.5 is smaller than a threshold, where this maxima is and how high depends on w,x,y, and f. This means, for a point w,x,y in simplefunction evaluate the maximize(complexfunction,f=0..0.5) and evaluate if it is smaller than the threshold. Find the highest point in simplefunction while this is true.

@mmcdara

Thanks again for your help. The functions were only placeholders, the problem what i have is that complexfunction cannot be evaluated with the maximize() function. In this example the real complexfunction is not solved for the third maximum, which I need to calculate the global maximum of the function only f= 0 and f= 0.5 are declared as a maximum.

Download maximum-not-found.mw

@mmcdara 

Here is my problem. I think I may not have been clear about my objective in the 'inner' maximization of complexfunction. In the 'inner' Maximize, I don't want x and y to be maximized, only f. The point (x, y) should be excluded from the maximization of the complexfunction and treated as a constraint for the "outer" maximization of simplefunction.

Perhaps the Maximize function cannot accommodate this type of constraint, where the constraint needs to be evaluated for each point (x, y) in the 'outer' Maximization. Therefore, I was wondering how to achieve this.

@mmcdara 

Hi, thanks for the response. The problem my own functions are derived from a complex system. Therefore I tried to illustrate the problem with the following example, I have two functions functionSimple g(x,y) and complecfunction h(x,y,f). Please note, that i cannot maximize the complexfunction beforehand, because it is dependend on the point where the functionSimple is evaluated. What i want to calculate is, that being on the isocline 1 on h(x,y,f) what is the maximal achievable value in g(x,y). Here the definition:

functionSimple := x*y;
complexfunction := -2.2*x^3 - 0.9*x*y^2 + x + 1.5*y^2 - 0.21 + f;
ploxsimple := contourplot(functionSimple, x = -1 .. 1, y = -1 .. 1, view = [-1 .. 0, -1 .. 0], contours = [1, 0.75, 0.5, 0.25], numpoints = 100);
plocomplex := contourplot(subs(f = 1, complexfunction), x = -1 .. 1, y = -1 .. 1, view = [-1 .. 0, -1 .. 0], contours = [-2, -1, 0, 1, 2], numpoints = 100);

Maximize(functionSimple, {Maximize(complexfunction, {f <= 1})[1] = 1}, initialpoint = {x = 0, y = 0});

This last expression does not work, "no improved point could be found". But when I insert the f = 1, which will obviously be the maximum of complexfunction regarding f under the boundary that f<=1, this works fine:

Maximize(functionSimple, {subs(f = 1, complexfunction) = 1}, initialpoint = {x = 0, y = 0});

I hope it is a bit clearer what i meant.

@Mariusz Iwaniuk 

Thank you for your response. I have now the problem with that expression, that for certain values the expression is complex with an imaginary part of 0.*I or 10^-30 and so on. Here is an code example.

INV := invztrans((z - 1)^2/(a*z^2 + b*z + c), z, n);
INVnew := simplify(allvalues(INV));
evalf(subs(a = 2, b = 1, c = 4, eval(subs(n = 16, INVnew))));

#-125.345817565917968749999999999999999999999999999999999999998 - 0.*I

The problem is that I am using an optimization methode after this, and the Re() command out of Maple takes a lot of time to evaluate if a,  b, and c are not substituted. Do you have any idea for that?

Page 1 of 1