Maple 2020 Questions and Posts

These are Posts and Questions associated with the product, Maple 2020

This ode

ode:=diff(y(x),x)=sqrt(1-y(x)^2)

has general solution y(x) = sin(x + _C1) but it also has solution y=-1 and y=+1. Since these extra solutions can't be obtained from the general solution by specific value of the constant of integration, they are singular solution.

But I am not able to get Maple to show these:

restart;
ode:=diff(y(x),x)=sqrt(1-y(x)^2);    
dsolve(ode);
dsolve(ode,'singsol'='all',[separable]);
dsolve(ode,[separable]);

We can check that y=1.,y=-1 are solutions

odetest(y(x)=1,ode);
odetest(y(x)=-1,ode);

0
0

Only after I used this, was Maple able to gives these solutions

dsolve(ode,'Lie');
dsolve(ode,'Lie',singsol=all);

So only when using `Lie` symmetry methods and also using singsol=all it worked.

Most people will not think of using this specialized option.

Why Maple did not give these singular solutions using the standard dsolve(ode,singsol=all) command?

Should it not have done so? Now it makes it more confusing as to which option to use to obtain the singular solution, as one might have to keep trying different options.

What do others think? 

Maple 2020.2

I need help for designing a procedure for Schubert Kronecker polynomial program in maple.

so i have a little school laptop and maple on it works just fine. Then i have my all powerful gaming desktop with an AM RTX 3700x ,RTX 2070S, SSD and 32GB ram.

I have never seen maple run so slow on any pc as i have on my desktop. It is completely impossible to use maple. Just writing normal input like 123 takes forever. One thing i have noticed is evertime i do some sort of action, then the icons to the left slowly go from being colored to grey and back to colored before i can do a new action.

The two images below show an example here you can see it is about to go from being colored to being grey, when i try to mark stuff. I have tried to install the x64 and x86 version, i have tried giving it 4096 ram in the ini file and i have tried removing splash. Nothing works....

 

This is the last step of my calculation. I get  following system of equations:

s:={a__11 = -b__1^2 + 5/4, a__12 = -b__1*b__2 + 7/4, a__13 = -b__1*b__3 - 1/2, a__14 = -b__1*b__4 - 1/2, a__15 = -b__1*b__5 - 1/2, a__16 = -b__1*b__6 - 1/2, a__17 = -b__1*b__7 - 1/2, a__22 = -b__2^2 + 5/4, a__23 = -b__2*b__3 - 1/2, a__24 = -b__2*b__4 - 1/2, a__25 = -b__2*b__5 - 1/2, a__26 = -b__2*b__6 - 1/2, a__27 = -b__2*b__7 - 1/2, a__33 = -b__3^2 - 1, a__34 = -b__3*b__4 + 1, a__35 = -b__3*b__5, a__36 = -b__3*b__6, a__37 = -b__3*b__7 + 1, a__44 = -b__4^2 - 1, a__45 = -b__4*b__5 + 1, a__46 = -b__4*b__6, a__47 = -b__4*b__7, a__55 = -b__5^2 - 1, a__56 = -b__5*b__6 + 1, a__57 = -b__5*b__7, a__66 = -b__6^2 - 1, a__67 = -b__6*b__7 + 1, a__77 = -b__7^2 - 1, b__1 = b__1, b__2 = b__2, b__3 = b__3, b__4 = b__4, b__5 = b__5, b__6 = b__6, b__7 = b__7}

 

I want to solve this system of equations

solve(s,{a__11, a__12, a__13, a__14, a__15, a__16, a__17, a__22, a__23, a__24, a__25, a__26, a__27, a__33, a__34, a__35, a__36, a__37, a__44, a__45, a__46, a__47, a__55, a__56, a__57, a__66, a__67, a__77, b__1, b__2, b__3, b__4, b__5, b__6, b__7})

 

But I  didn't get any more valuable information 

Actually I'd like to  know if there is no  real solution.

If there is a real number solution,   one is enough for me.

Any help would be greatly appreciated

 

Hello there, 

Would you allow me to ask this question?

What would be a way to simplify the expression 'eq9_32a' below to the 'Desired' expression?

Intuitively, the numerator and denominator can be divided by 'sqrt(r^2 + 1)', but the 'Simplify' instruction did not do that. 
 

restart;

eq9_30 := T__e_n = 2*(s/s_hat) / ((1+r*s/s_hat)^2+(s/s_hat)^2);

T__e_n = 2*s/(s_hat*((1+r*s/s_hat)^2+s^2/s_hat^2))

(1)

eq9_31 := solve(diff(rhs(eq9_30), s)=0,s);

s_hat/(r^2+1)^(1/2), -s_hat/(r^2+1)^(1/2)

(2)

eq9_32a :=  T__e_np = simplify(subs(s=eq9_31[1] , rhs(eq9_30))) assuming r::real;

T__e_np = (r^2+1)^(1/2)/(r^2+(r^2+1)^(1/2)*r+1)

(3)

Desired := T__e_np = 1/(sqrt(r^2 + 1) + r);

T__e_np = 1/((r^2+1)^(1/2)+r)

(4)

 


Merry Christmas!

Download Q20201208.mw

Dear Community,

I try to solve a simple flow problem between two fluid tanks. They are connected with a pipe and a pump. Simulation runs from 0s to 3000s. Fluid levels are H1(t), H2(t), and flow rate between the tanks is Q1(t). I operate the pump between 500s and 2000s, with a constant head, and after that I would like to shut down the system from 2000s to 2500s (i.e. for 500s Q1(t) should be 0, and consequently H1, H2 remain constant) and then reopen it again, so tanks can equilibrate. I've attached the worksheet (FlowProblem.mw).

I tried to achieve this in the event section of dsolve (indicated in red), but it seemingly did not work out. So my question is: how to correctly specify it in dsolve, so flow (Q1) remains 0. between 2000s and 2500s, and can flow again afterwards? Am I right to do it in dsolve, or is there any other way to do it?

Your kind help is appreciated in advance,

best regards

Andras

FlowProblem.mw

I know it is not hard to write such a function, but can be tricky for all options. For 1D and uniform grid, it is straight forward to code it. The formula is here  https://en.wikipedia.org/wiki/Trapezoidal_rule#Uniform_grid

I was looking to see if Maple has this build-in. This is the equivalent of Matlab's trapz

I know about Student:-Calculus1:-ApproximateInt with option trapezoid. But this is not exactly the same. Matlab's trapz can accept just a list of numbers directly (the y values), or a a matrix of numbers (2D function), and applies trapezoidal rule. The default is unit spacing.

It is a simplified version of Student:-Calculus1:-ApproximateInt in a way, but I found trapz easier to use, if one has list of numbers generated before, (i.e. function values) and want to applies trapezoidal rule on it as is. It is more more convenient that way.

Here is an example from Matlab's help. Given

Y = [1 4 9 16 25];
Q = trapz(Y)

it gives 42.

One does not need to define f(x) or x=from..to  as in the case with Maple's ApproximateInt.

Matlab's trapz also supports Matrix as input not just 1D list of numbers.

Does Maple have something similar?

 

 

 

Maple mint checks for errors in one file only at a time. But not across mutliple files for correctness of calls between them. (As is done in statically complied langauges, where the compiler has access to all files and can do this).

One has to run the code to find such errors. For example, given

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

foo:=proc(n::integer,m::string,$)
 print("in foo, n=",n, "m = ",m );
end proc;

boo:=proc()
#How to make Maple check this call is wrong using mint? 
#before running the code? It has wrong type, and also
#missing one argument.

 foo(0.1);   
end proc;

Doing 

maplemint(boo)
maplemint(foo)

shows no errors. 

In a large program, with many calls between many procs in different packages, it will be nice if one can detect such errors before running the program if possible, than having to run the program, making sure all possible paths are taken each time.

Such an error could be hidden in the code for  sometime without one noticing it (For example, if one changes the API to a proc, but not change each call to the changed proc in order to update the call to the new API), and the code path for the now wrong call is not invoked in the current test since testing does not do 100% coverage all the time.

Is there any option in mint I might overlooked to do this?  if not, how hard would it be for Maple to add such a feature? i.e. give mint, either a set of files, or .mla library, and have it check all calls between all functions, for correctness.
 

The last months Maple 2020 suffers from frozen interface behavior:

I simply wanted to save a file, but that resulted in a frozen window:

After 10 minutes the file explorer window appeared, but also this screen is unresponsive.

I reinstalled Maple last month, but that didn't help. Remarkably, the problem comes and goes. It seems to me that some java problem is making my life difficult.
Any ideas?
kind regards,

Harry

 

ps I ran the process monitor of Sysinternals, but I have no idea if this has any relevance to the problems:

11460 RegOpenKey HKCR\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\PackageRepository\Extensions\windows.protocol\Maple.cwmaple.2020 NAME NOT FOUND Desired Access: Read

11460 ReqQueryValue HKCR\Maple.cwmaple.2020\URL Protocol NAME NOT FOUND Length: 12

11460 RegOpenKey HKCU\Software\Classes\Maple.cwmaple.2020  NAME NOT FOUND Desired Access: Maximum Allowed

how to compute the integral of (1+lnx)/x in the interval from 1 to e by using substitution teqnique. Substitute u=1+lnx

Hello there, 

Would you please tell me how to make the expression 'eq9_13_m3' into 'desired' by substituting part of 'eq9_13_m3' with 'aux2' expression?


 

restart;

eq9_13_m3 := 2*R__R*s*omega__s*L__sigma_S/(s^2*L__sigma_S^2*omega__s^2 + R__R^2);

2*R__R*s*omega__s*L__sigma_S/(s^2*L__sigma_S^2*omega__s^2+R__R^2)

(1)

aux2 := s_hat = R__R/(L__sigma_S*omega__s*s);

s_hat = R__R/(omega__s*L__sigma_S*s)

(2)

desired := 2*(s/s_hat) / (1+(s/s_hat)^2);

2*s/(s_hat*(1+s^2/s_hat^2))

(3)

 


Merry Christmas!

Download Q20201204.mw

```

f:=(1/(1-x^2));

s:=convert(f,FormalPowerSeries)       

s:=simplify(s)          

c:=k->(op(1,s))/(x^k);

```

I'm trying to get it to find that c(k)=x^2 starting with x^k*2, but it divides by x^2 instead of x^k.  What am I doing wrong?

This is an issue I had for long time. Though to ask about it.

Any one who used Database[SQLite] in Maple probably know this.  I'd like to do kernelopts('assertlevel'=2): but this does not work when using Database[SQLite] as it raises assertion failed, due to the way data is read from database and converted to Maple variable.

It happens at the statement 

         variable_to_read := Database[SQLite]:-FetchAll(stmt); 

For an example, the table I have in sql, has many fields. some are strings and some are integers. Lets say I want to read field called run_it corresponding to rowid I enter. So I do this in Maple

local run_it::integer;
.....
counter :=1;

stmt := Database[SQLite]:-Prepare(conn, cat("SELECT run_it FROM PROBLEMS WHERE rowid=",convert(counter,string),";"));    

run_it := Database[SQLite]:-FetchAll(stmt); 

The assetion error happens at the second call above. 

Error, (in dsolver_test:-MAIN_STEP) assertion failed in assignment, expected integer, got Matrix(1, 1, {(1, 1) = 1}, order = C_order, attributes = [source_rtable = (Array(1..1, {(1) = 1}, order = C_order))]) 
 

Once I remove kernelopts('assertlevel'=2): everything works fine with no problems at all. So I been running my program for more than a year now without the assert set.

Since I have hundreds of  such calls, and I do not think try/catch will work here, any one knows of a way to handle this, so I can turn on assertlevel to help catch any other problems some where else in the program, and still use SQLite ?

I could make an example if needed. I would need to create new database file and so on. This will take time.

Maple 2020.2

ps. Database[SQLite] works very well and very fast. I am surprised how fast it reads the data. few thousands records, each is 25 fields, and it does it in few seconds. Good implementation.

Edit

I found that by removing all the type specification on my Maple variables, that I read the SQL data into using FetchAll(stmt);  it now works!

So I am able to now use kernelopts('assertlevel'=2):

So intead of doing  

local local run_it::integer;  and then call SQL, I just now do  local run_it; with no type.  I had to remove the type on many such variables I had.  Now no assertion error any more during the SQL calls.

This works for me for now. I should have done this long time ago, I just did not think about it before. I would have liked to keep the type here.

Edit: I see answer below that allows me to do this by changing assert level just for the call to SQL which is good solution.

 

 

 

 

In Maple 2020.2, and after I changed to interface(warnlevel=4); then once in a while, I now see this message 

                                  Warning, persistent store makes readlib obsolete

followed by name of the file and the line number. It always happen at calls to timelimit(the_time_limit,:-dsolve(....

It seems harmless so far, as I have not seen any side effect.

 

I googled and the above, and see few places where it shows up, but no clear explanation what it is and what it means. But the messages I saw at google are a little different. They look like this

               WARNING: persistent store makes one-argument readlib obsolete

While the one I get is a little different as you can see. (no one-argument in it)

I am using my own package in .mla file during running the code if this makes any difference.

Is there any place where it explains what this means and why it happens sometimes? Sorry, can't make MWE, since it seems to happen at random. But I noticed it always happens at call to dsolve when I saw it.

Maple 2020.2

Physics 884

Windows 10
 

I'm trying to make a table of values as a data table.  The problem is that it's making more rows than loops, I'm not able to make an empty DataFrame, and that I have to add an extra row to align the values, so I need to remove a row, and change the indexes.  Any help with making data tables work properly, would be greatly appreciated.

```

newt := x -> evalf(x - f(x)/D(f)(x));

f:= x -> x^6-2; # function to analyze

rt[0] := 1.5; #x0 value


n_error[0]:=1.5-newt(1.5): #error of first estimate
     

DF := DataFrame( <x|n_error>):# create a dataframe to store estimates, and error rates
for count from 0 to 10 do; nerror[count]:=abs(x[count]-x[count-1]);    rt[count]:=x[count-1];
x[count + 1] := newt(x[count]); DF:=Append(DF,DataSeries(<rt[count]|nerror[count]>),mode=row);    
end do:

NewtonData:=DataFrame(Remove( DF, 2, mode=row)):
NewtonData


```

First 25 26 27 28 29 30 31 Last Page 27 of 55