nm

8552 Reputation

19 Badges

12 years, 353 days

MaplePrimes Activity


These are questions asked by nm

I have code which in module which does this

           DEtools:-kovacicsols(ode,func)

Where ode is some ode and func is y(x).  When I step in the debugger, I get exception at this. It says

       DBG> DEtools:-kovacicsols(ode,func)
       Error, `DEtools` does not evaluate to a module

Same exact code works OK from worksheet as expected.   SO for some reason, inside this module it does not see DEtools and I have no idea why.

Then I tried with :-  before DEtools, but this did not help. it gives

DBG> :-DEtools:-kovacicsols(ode,func)
Error, `table([(dperiodic_sols)=proc () `DEtools/init`() <> 0; `ODEtools/intfactor`(_passed); end etc...
` does not evaluate to a module

In a worksheet, it all works OK

ode:=diff(diff(y(x),x),x) = (-3/16/x^2-2/9/(x-1)^2+3/16/x/(x-1))*y(x);
func:=y(x);
DEtools:-kovacicsols(ode,func)

Gives the solution with no error.

Any suggestion what could be the cause and what to try next? I never seen anything like this. I am running this code using 

interface(warnlevel=4);
kernelopts('assertlevel'=2):

I am able to make a MWE. It seems this always happens in the debugger.  But if  I let it run, it works somehow. Only when I try to step into it, it gives error. Here is MWE

interface(warnlevel=4);
kernelopts('assertlevel'=2):
foo:=proc(ode,func)
   local result;
    DEBUG();   
    result:=DEtools:-kovacicsols(ode,func);
    return result;
  end proc;

And now

ode:=diff(diff(y(x),x),x) = (-3/16/x^2-2/9/(x-1)^2+3/16/x/(x-1))*y(x);
func:=y(x);
foo(ode,y(x))

Now in the debugger if I do DEtools:-kovacicsols(ode,func) or if I stepin the call, I get the error. But I hit the continue botton, I do not get the error and it gives solution. 

Why this happens?

Maple 2021.2 on windows 10

Why int gives this error? Is this a known problem?

Update

fyi, This is reported to Maplesoft.

Here is updated worksheet. The int() command does not generate the error the second time it used, but generates the error the very first time used. Hopefully will be fixed in 2022 Maple.
 

interface(version);

`Standard Worksheet Interface, Maple 2021.2, Windows 10, November 23 2021 Build ID 1576349`

restart;

Example 1

 

expr:=(7*x - 3 + sqrt(x^2 + (x^3*(x - 1)^2)^(1/3) - x) + sqrt(-2*((-x^2 + x + (x^3*(x - 1)^2)^(1/3)/2)*sqrt(x^2 + (x^3*(x - 1)^2)^(1/3) - x) + x^2*(x - 1))/sqrt(x^2 + (x^3*(x - 1)^2)^(1/3) - x)))/(12*x*(x - 1));

(1/12)*(7*x-3+(x^2+(x^3*(x-1)^2)^(1/3)-x)^(1/2)+(-2*((-x^2+x+(1/2)*(x^3*(x-1)^2)^(1/3))*(x^2+(x^3*(x-1)^2)^(1/3)-x)^(1/2)+x^2*(x-1))/(x^2+(x^3*(x-1)^2)^(1/3)-x)^(1/2))^(1/2))/(x*(x-1))

int(expr,x)

Error, (in IntegrationTools:-Indefinite:-AlgebraicFunction) invalid argument for sign, lcoeff or tcoeff

int(expr,x)

int((1/12)*(7*x-3+(x^2+(x^3*(x-1)^2)^(1/3)-x)^(1/2)+(-2*((-x^2+x+(1/2)*(x^3*(x-1)^2)^(1/3))*(x^2+(x^3*(x-1)^2)^(1/3)-x)^(1/2)+x^2*(x-1))/(x^2+(x^3*(x-1)^2)^(1/3)-x)^(1/2))^(1/2))/(x*(x-1)), x)


 

Download int_problem_feb_13_2022.mw

I need to use convert of complex exponentials to trig, but only to convert exp(I*x) to cos/sin using Euler formula.

The problem is that, since this is done in code without looking at what is inside the exp(), Maple will also convert non complex exponentials as exp(x) to hyperpolic trig which I do not want.  An example will make this clear

For an example, given exp(3*I*x - x)  and applying convert/trig to this it gives 

             (cosh(x) - sinh(x))*(cos(3*x) + sin(3*x)*I)                       --(1)

But I only want to conver the exp(3*I*x) part of the of the above to obtain

          exp(-x) *  (cos(3*x) + sin(3*x)*I)                          ---(2)

I can break  exp(3*I*x - x) first using expand command and obtain  exp(-x) exp(3*I*x) and then parse this and filter out the complex exponentials (may be using select with has I) and then use convert on those terms only leaving the non-complex exponentials alone. But this gets messy for more complex exponentials.

Is there an easy way to tell Maple  to convert expression of the form exp(I*f(x) + g(x)) to trig but only to sin/cos, hence leaving the exp( g(x) ) as a factor? I looked at help but see nothing there so far.

Maple 2021.2

On my PC I can't see the plus and minus sign in the quotient expression when using Student:-Basics:-LongDivision.

Is this a know display issue and is there to correct it?

Windows 10, Maple 2021.2

interface(version);

`Standard Worksheet Interface, Maple 2021.2, Windows 10, November 23 2021 Build ID 1576349`

restart;

A:=4*x^4;
B:=3*x^2-60*x+36;
Student:-Basics:-LongDivision(A,B,x); #NOTICE, no + sign shows in quotient

A := 4*x^4

B := 3*x^2-60*x+36

"[[(`%+`(3 x^2,-60 x,36)),[[,(4 x^2)/3,(80 x)/3,1552/3,],[),4 x^4,,,,],[,(4 x^4-80 x^3+48 x^2)/(),],[,,80 x^3-48 x^2,,],[,,(80 x^3-1600 x^2+960 x)/(),,],[,,,1552 x^2-960 x,,,],[,,,(1552 x^2-31040 x+18624)/(),,,],[,,,,30080 x-18624,,,,]]]]"

rem(A,B,x);
quo(A,B,x); #signs shows up here OK

30080*x-18624

(4/3)*x^2+(80/3)*x+1552/3

 

Download no_signs.mw

I noticed Maple changes 1/(4*(x-2)) to 1/(4*x-8)  when copying the output and pasting it back to the worksheet.  

But in the variable it does remain 1/(4*(x-2))  which is what I wanted, as I am going to look for this form later on and I do not want it expanded.

But I am curious why Maple does this. It is a little annoying when copying something from one worksheet to another and have it change.  Here is a small movie and the code to see it. 

Is there a way to prevent this automatic expansion?  Maple 2021.2 on windows 10

 

code

r:=(x^4-8*x^3+24*x^2-24*x+12)/((4*x^2*(x-2)^2)):
rf:=convert(r,fullparfrac,x);

I use worksheet interface and have my display settings as the following

First 38 39 40 41 42 43 44 Last Page 40 of 164