96 Reputation

2 Badges

15 years, 76 days

MaplePrimes Activity

These are answers submitted by ciccarese

Hi alec, hi joe,

thanks a lot for your comments, you have really helped me a lot. I must admit that I don't really understand joe's approach and alec's approach seems to work better. However, there are still two problems:

- I forgot to emphasize that f(x, y1, y2)=0 should always hold. Hence, in the end I would like to have numerical values for y1, y2 and x, and not y1(x) and y2(x).

- I think, in the last row of alec's code, I should take into account that x depends both on y1 and y2.

Therefore, I think the last row should be something like

solve({diff(g2, y2) + diff(g2, x)*d2 + diff(g2, x)*d1*diff(y1, y2), f=0}, {y2, x});

My functions are (simplified)

f:=1/2*x*(1-x) - (y1+y2)*x

g1 := y1 *x - 1/2*y1
g2:= y2*x - 1/2*y2

This should give me y1=1/16, y2=1/8 and x=5/8. The solve - command above gives me something close to that but not really correct. As I said, the standard way would be to solve first f=0 for x(y1, y2), insert this into g1 and solve dg1/dy1 for y1(y2) and then insert this into g2 and solve dg2/dy2 for y2. It works for this simple example, but not for the general problem, where already the first step is not possible.

Do you have any idea how I could proceed?

Thanks again,


thanks a lot! I'll try that out (it will take some time), although I have to admit that I'm not sure if I really understand it. If I get it right, the solve command gives me the partial derivatives needed for e[3] and e[4] (uses the implicit function theorem, right?).

I'm impressed, thank you again!

Hello Axel,

thank you so much for your solution, you've really saved my day!

Obviously I should have tried solve() earlier...

Hello momiji,

thank you for your comment. I'm still thinking about this but I don't think it will help me much. The problem is that the solutions, for example Xz1=Xz1(Ez1,Ez2,Ez3), then serve as an input to define the functions P1(Ez1,Ez2,Ez3),P2(),P3(). These functions are then maximized with respect to Ez1, Ez2, Ez3. I tried to solve the first-order-conditions (FOC's, i.e. derivative=0) for this using fsolve().

It makes a difference whether the condition Ez1=Ez2=Ez3 is already inserted before taking the derivatives or afterwards (consider as an example a function f(x,y) of which you are trying to find the maximum: even if you know that it has to be at a point x*=y* you should not just examine the function f(x,x)). Hence, I think the results will be wrong if I insert the symmetry condition already at the beginning. However, I'm open to your comments.

I have now made use of the symmetry condition before calling fsolve(). The changed algorithm has now been running for about 6 hours and has not delivered a solution yet, although there is only one remaining equation that fsolve() has to solve.

Hello everybody,

thanks a lot for the replies. However, I'm still stuck with this problem.

Indeed I had tried solve() before but it didn't work. Then I switched to fsolve() since I guess that it usually is easier for Maple to solve a system of equations numerically than analytically.

Setting _EnvTry:='hard': doesn't seem to help.

Instead of specifying boundaries I'm just giving fsolve() a starting value now, but the results don't improve.

In the solution, all variables should have the same value. So now I'm trying to make use of this symmetry although it would be nicer if it came out as a result of the computation. The system is then reduced to three equations in one unknown. However, I haven't got any results for this simpler problem so far.

I have added the file now, so maybe someone can have a look at it. I have written it in the .mw  format, but now saved it in the .mws format just as Axel Vogt told me to do. I'm not sure if it works like this, at least it works in the .mw format. I'm using Maple 11.


Download 9379_ciccarese_fsolve_problem.mws
View file details

Page 1 of 1