rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

Desolve asks a question assume can't answer by default #2313

Open rtoy opened 2 months ago

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-05 23:38:34 Created by peterpall on 2023-04-30 07:11:36 Original: https://sourceforge.net/p/maxima/bugs/4136


First we define a differential equations and make sure that the thing desolve will have to warn about is true:

eq1:U_Supply=U_In(t)+L_Cable*diff(I_Cable(t),t);
eq2:I_C(t)=C_In*diff(U_In(t),t);
eq3:U_In(t)=R_Load*(I_Cable(t)-I_C(t));
assume(L_Cable*(4*C_In*R_Load^2-L_Cable)>0);
is(L_Cable*(4*C_In*R_Load^2-L_Cable)>0);

If we now run a desolve() the desolve() asks the thing we told assume(), but the assume() database cannot find it. For some reason I seem to be able to get two questions, one that matches the assume() and one that doesn't.

(%i6)   desolve([eq1,eq2,eq3],[U_In(t),I_Cable(t),I_C(t)]);
"Is "L_Cable*4*C_In*R_Load^2-L_Cable" positive, negative or zero?"

or:

(%i6)   desolve([eq1,eq2,eq3],[U_In(t),I_Cable(t),I_C(t)]);
Is L_Cable*(4*C_In*R_Load^2-L_Cable) positive, negative or zero?

No idea under which condition I get which of these questions.

If we run an additional expand()

assume(expand(L_Cable*(4*C_In*R_Load^2-L_Cable)>0)));

the assume database will be able to provide desolve with the answer of its question.

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-05 23:38:35 Created by peterpall on 2023-04-30 07:51:45 Original: https://sourceforge.net/p/maxima/bugs/4136/#33e4


rtoy commented 2 months ago

Imported from SourceForge on 2024-07-05 23:38:38 Created by rtoy on 2023-04-30 14:04:58 Original: https://sourceforge.net/p/maxima/bugs/4136/#b870


One point. You assume that L_Cable*(4*C_In*R_Load^2-L_Cable)is positive. But maxima is asking for the sign of L_Cable*4*C_In*R_Load^2-L_Cable. These aren't the same.

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-05 23:38:42 Created by peterpall on 2023-04-30 19:50:22 Original: https://sourceforge.net/p/maxima/bugs/4136/#b870/3bbd


I drag-and-dropped this from a maxima session. If I do that again I get:

Is L_Cable*(4*C_In*R_Load^2-L_Cable) positive, negative or zero?

which matches the assume() I did before.

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-05 23:38:45 Created by robert_dodier on 2023-11-04 23:04:08 Original: https://sourceforge.net/p/maxima/bugs/4136/#db43