[go: up one dir, main page]

Unanswered Questions

This page lists MaplePrimes questions that have not yet received an answer

Can solve give internal Maple error of division by zero to the caller?

Also when I run this using kernelopts('assertlevel'=1): or kernelopts('assertlevel'=2):, then not able to catch the internal error any more, which is division by zero using try/catch.

Only when kernelopts('assertlevel'=0).  can try/catch trap the error.

This means now I have to set kernelopts('assertlevel'=0) before calling solve to be able to trap the error and set it back to kernelopts('assertlevel'=2) after that, else the whole program halts.

But my main question is: can solve throw internal error of division by zero? I mean, is this expected sometimes to happen? I would have thought Maple should internally catch this and simply return no solution if can't solve it.

This equation is auto generated and the program calling solve on it to see if it can solve it.

Here is the worksheet

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1792 and is the same as the version installed in this computer, created 2024, August 22, 12:6 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

eq:=1 = 1/((exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*X + exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*x0 + 2*Y + 2*y0)^2*Y*(exp(X*Y)^2*exp(X*y0)^2*exp(x0*Y)^2*exp(x0*y0)^2*X + exp(X*Y)^2*exp(X*y0)^2*exp(x0*Y)^2*exp(x0*y0)^2*x0 + 2*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*X*Y^2 + 4*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*X*Y*y0 + 2*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*X*y0^2 + 2*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*Y^2*x0 + 4*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*Y*x0*y0 + 2*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*x0*y0^2 - X^2*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0) - 2*exp(X*Y)*exp(X*y0)*x0*exp(x0*Y)*exp(x0*y0)*X - exp(X*Y)*exp(X*y0)*x0^2*exp(x0*Y)*exp(x0*y0) - 2)):

kernelopts('assertlevel'=2):
try
   solve(identity(eq,X),[x0, y0]);
catch:
   print(lastexception);
end try;

Error, (in unknown) assertion failed

kernelopts('assertlevel'=1):

try
   solve(identity(eq,X),[x0, y0]);
catch:
   print(lastexception);;
end try;

Error, (in unknown) assertion failed

kernelopts('assertlevel'=0):

try
   solve(identity(eq,X),[x0, y0]);
catch:
   print(lastexception);
end try;

unknown, "numeric exception: division by zero"

 


 

Download division_by_zero_solve_identity_august_23_2024.mw

i have solution of ODE but again i want take derivative from solution function F then i want take reciprocal of derivative
if F'=G then i want 1/F'=1/G like that i want all solution by list and if possible don't give the parameter a sequence  it will be better

thanks for any help

K := diff(G(xi), xi $ 2) = -lambda*diff(G(xi), xi) - mu;
                 2                                    
                d                    / d        \     
          K := ----- G(xi) = -lambda |---- G(xi)| - mu
                   2                 \ dxi      /     
                dxi                                   

V:= [seq](-1..1, 1/2);
                          [    -1     1   ]
                     V := [-1, --, 0, -, 1]
                          [    2      2   ]

interface(rtablesize= nops(V)^3):
DataFrame(
    <seq(seq(<a | b | rhs(dsolve(eval(K, [lambda,mu]=~ [a,b])))>, a= V), b= V)>,
    columns= [lambda, mu, F]
);

loading

Error occurred during PDF generation. Please refresh the page and try again

 

*****************************

EDIT: Thanks for the help i used the restore backup feature. I made my anti virus not react to maple since i thought that might work, so far no more problems. Else this is a fix if anybody else has this problem.

******************************

Hi, so my maple freezes during simple tasks, such as trying to type something, or somtimes copying and inerting the results from a previous equation, the feature where you mark something and drag the answer to somewhere else also does this. When this happens, maple completely freezes and i'm forced to close the app with taksmanager, where i lose everything i have worked on, sometimes for the past hour because i didn't save every minute which is basically not something you can do.

Is there any fix for this or anything i can do to prevent this, cause it really sucks. 

I'm on a windows 11 with maple 2024

Hi
most of my equation when i wanna solve it is give me something like thus equation and it take a lot time to calculate and i don't get any answer after 1 hour past and still searching for finding parameter how i can do in fast way or maybe if exist  can i use mathematica or matlab is better for calculating this or not ?

F-P.mw

Hello,

How can I reduce time calculations for the integral process?

Determining H[1] and HH[1] is very boring!!

 

time_consuming_calculations.mw

Strange thing happening when changing the view zoom factor, as images are not scaling.

That makes it very difficult to generate print documents, a case we've talked about previously.

The first image is a screenshot with 100% scale factor, the other one with scale factor 400%.

One could argue, that I could switch to Print Layout Mode. But the problem there is that I don't have any view zoom factor at all.

Good morning, I'm trying to evaluate this equation when x = 10 degrees so that it gives me a value something like this -0.1671897 etc. but I can't find a way to do it. I've tried to do it like this:

with(Degrees);
evalf(eq, tand(10));

with(Units:-Simple);
evalf(eq, tan(10*Unit(degree) ;

But it gives me an error. In other words, how do I evaluate the equation at 10 degrees.

 

STeM is a large INTERACTIVE Maple package and I need to allow the user to make decisions (like factor choices etc) at intermediate places in long computations. The problem is that in such long computations the "readstat" output goes below the visible screen and hence the user cannot see all the choices as they are requested before the end at which of course then it all pops up. As a very simple example consider the one line code
 
for i from 1 to 100 do x[i]:=readstat("pick a value for x: ");od;
 
After some entries the little window from readstat is visible but you cannot see the selections that you are inputing  for x[i] BEFORE termination. My problem is more complicated than this but this is the essence of it. I need to see all 100 outputs from "readstat" as you proceed in the loop. Is there a work-around or do I need to use a Maplet or whatever? If you cannot assist me, can you please indicate who can help me solve my problem. Thanks
 
 

@sand15 answered my question but I cannot reply to him. Preview is ok. When I press 'Submit' there is a blue bar and a dot running from the left to the right. It never stops. Why?

Hello

In my last question, I asked for help converting an old Maple V3 code to the latest version. With the help of  @Rouben Rostamian, I managed to get most of the procedures working again. Unfortunately, there is one procedure that I cannot figure out how to convert. Below is the procedure, along with an example that works and one that does not.

saturbasis := proc(ps,js,ord)
 local qs,gb,zz,j,aux;
     print("ps = ",ps):
     print("js = ",js):
	 print("ord = ",ord):
     if js <> {} then
         qs := [op(ps),'`@z`.j*js[j]-1' $ ('j' = 1 .. nops(js))];print("qs = ",%):
         zz := ['`@z`.(nops(js)-j+1)' $ ('j' = 1 .. nops(js))];print("zz = ",%):
         aux:= [op(zz),'ord[nops(ord)-j+1]' $ ('j' = 1 .. nops(ord))]:print("aux = ",aux):
         gb := grobner['gbasis'](qs,aux,'plex');
         qs := [];
         for j to nops(gb) do
             if {op(zz)} minus indets(gb[j]) = {op(zz)} then
                 qs := [gb[j],op(qs)]
             fi
         od
     else qs := ps
     fi;
     qs
end proc:

First example:

ps:=[2*x1^2 + 3*x2^2 + 4*x1 + x2, x1*x3 - 3*x2 - 1, 2*x1*x4 + 3*x2 + 1]:
js:={x1}:
ord:=[x1, x2, x3, x4]:

saturbasis(ps,js,ord);
             [    2       2                                
    "ps = ", [2 x1  + 3 x2  + 4 x1 + x2, x1 x3 - 3 x2 - 1, 

                        ]
      2 x1 x4 + 3 x2 + 1]


                         "js = ", {x1}

                   "ord = ", [x1, x2, x3, x4]

             [    2       2                                
    "qs = ", [2 x1  + 3 x2  + 4 x1 + x2, x1 x3 - 3 x2 - 1, 

                                   ]
      2 x1 x4 + 3 x2 + 1, @z x1 - 1]


                         "zz = ", [@z]

                 "aux = ", [@z, x4, x3, x2, x1]

Warning, grobner[gbasis] is deprecated. Please, use Groebner[Basis].
[    2       2                                                  
[2 x1  + 3 x2  + 4 x1 + x2, x1 x3 - 3 x2 - 1, x2 x3 + 2 x1 + 4, 

           ]
  2 x4 + x3]


Second example:

ps:=[2*x1*x4^2 + 3*x1 + x4 + 6, x3*x4^3 + 2*x4^4 - 9*x3 - 18*x4, 2*x2*x4^2 + 3*x2 - 4*x4 + 1]:
js:={2*x4^2 + 3, x4^3 - 9}:
ord:={2*x4^2 + 3, x4^3 - 9}:

saturbasis(ps,js,ord);
           [       2                  
  "ps = ", [2 x1 x4  + 3 x1 + x4 + 6, 

         3       4                        2                  ]
    x3 x4  + 2 x4  - 9 x3 - 18 x4, 2 x2 x4  + 3 x2 - 4 x4 + 1]


                          /    2        3    \ 
                "js = ", { 2 x4  + 3, x4  - 9 }
                          \                  / 

                           /    2        3    \ 
                "ord = ", { 2 x4  + 3, x4  - 9 }
                           \                  / 

          [       2                  
 "qs = ", [2 x1 x4  + 3 x1 + x4 + 6, 

        3       4                        2                    
   x3 x4  + 2 x4  - 9 x3 - 18 x4, 2 x2 x4  + 3 x2 - 4 x4 + 1, 

      /    2    \           /  3    \    ]
   @z \2 x4  + 3/ - 1, 2 @z \x4  - 9/ - 1]


                      "zz = ", [2 @z, @z]

                      [            3          2    ]
            "aux = ", [2 @z, @z, x4  - 9, 2 x4  + 3]

Warning, grobner[gbasis] is deprecated. Please, use Groebner[Basis].
Error, (in grobner:-gbasis) invalid input: Groebner:-Basis expects its 2nd argument, tord1, to be of type Or(ShortMonomialOrder,name,MonomialOrder), but received plex(2*`@z`,`@z`,x4^3-9,2*x4^2+3)

I suppose that the "." is no longer used as it was back in Maple V3, and it seems that the author of the procedure was creating extra auxiliary variables to solve the problem.


What did the author use @ for creating the variables?  And how to fix the error?

Many thanks
 

I need to seperate vectors  from projective geometry vectors in my package. I am experimenting with using row and column matrices for projective points and lines reppresentation. Two approaches are use here. The 1st converts the Matrices to Vectors and back in the procedure. I dont like that way. The 2nd approach, I worked out the equivalent of CrossProduct and DotProduct for the row and column matrices. That I think is better.

1st Question are there any other approaches worth looking at?Is there something in the Physics package that could be of use?

2nd Qusetion could a new data type be made with the properties of a vector that could be displayed differently.?

Say, for a point [ x : y : z ] and a line < x : y : z >, because projecive quantities as basically ratios..


 

restart

with(LinearAlgebra):

 

#

projcross:=overload([

proc(A::Matrix(1,3),B::Matrix(1,3))
option overload;
description "join of points";
local a:=convert(A,Vector[row]),b:=convert(B,Vector[row]);
uses LinearAlgebra;
print("line thro' points");
convert((a &x b)^%T,Matrix);
end proc,

proc(A::Matrix(3,1),B::Matrix(3,1))
option overload;
description "meet of lines";
local a:=convert(A,Vector[column]),b:=convert(B,Vector[column]);
uses LinearAlgebra;
print("intersect point");
convert((a &x b)^%T,Matrix);
end proc,

proc(A::{Matrix(1,3),Matrix(3,1)},B::{Matrix(1,3),Matrix(3,1)})
option overload;
description "incidence of point and line";
uses LinearAlgebra;
local a,b;
if type(A,'Matrix'(1,3))and type(B,'Matrix'(3,1)) or type(A,'Matrix'(3,1))and type(B,'Matrix'(1,3))  then #not working
a:=convert(A,Vector[row]);
b:=convert(B,Vector[row]);
end if;
print("if = 0 coincident");
a.b ;
end proc


]):

projcross(<<1|2|4>>,<<3|-5|7>>)

"line thro' points"

 

Matrix([[34], [5], [-11]])

(1)

projcross(<<1,2,4>>,<<3,-5,7>>)

"intersect point"

 

Matrix([[34, 5, -11]])

(2)

projcross(<<1|2|4>>,<<34,5,-11>>)

"if = 0 coincident"

 

0

(3)

projcross(<<34,5,-11>> ,<<3|-5|7>> )

"if = 0 coincident"

 

0

(4)

#This section is to derive a CrossProduct and DotProduct for row and column matrix inputs

M:=<A[1,1]|A[1,2]|A[1,3]> ; #point

M := Vector[row](3, {(1) = A[1, 1], (2) = A[1, 2], (3) = A[1, 3]})

(5)

N:=<B[1,1]|B[1,2]|B[1,3]> ; #point

N := Vector[row](3, {(1) = B[1, 1], (2) = B[1, 2], (3) = B[1, 3]})

(6)

(M &x N)^%T ; #line thro' points

3

(7)

R:=<A[1,1],A[2,1],A[3,1]> ;# line

R := Vector(3, {(1) = A[1, 1], (2) = A[2, 1], (3) = A[3, 1]})

(8)

S:=<B[1,1],B[2,1],B[3,1]> ;# line

S := Vector(3, {(1) = B[1, 1], (2) = B[2, 1], (3) = B[3, 1]})

(9)

(R &x S)^%T  ;# intersect point

[`?`]

(10)

 

T:=<A[1,1]|A[1,2]|A[1,3]>  ;#point

T := Vector[row](3, {(1) = A[1, 1], (2) = A[1, 2], (3) = A[1, 3]})

(11)

U:=<B[1,1],B[2,1],B[3,1]>  ;# line

U := Vector(3, {(1) = B[1, 1], (2) = B[2, 1], (3) = B[3, 1]})

(12)

DotProduct(T,U,conjugate=false) ; #check coincidence of point and line

A[1, 1]*B[1, 1]+A[1, 2]*B[2, 1]+A[1, 3]*B[3, 1]

(13)

V:=<A[1,1],A[2,1],A[3,1]> ;# line

V := Vector(3, {(1) = A[1, 1], (2) = A[2, 1], (3) = A[3, 1]})

(14)

 

W:=<B[1,1]|B[1,2]|B[1,3]> ;#point

W := Vector[row](3, {(1) = B[1, 1], (2) = B[1, 2], (3) = B[1, 3]})

(15)

DotProduct(V,W,conjugate=false)  ; #check coincidence of line and point

A[1, 1]*B[1, 1]+A[2, 1]*B[1, 2]+A[3, 1]*B[1, 3]

(16)

# CrossProduct and DotProduct procedure for matrix inputs

 

ProjCp:=overload([

proc(a::Matrix(1,3),b::Matrix(1,3))
option overload;
description "join of points";
local A:=a,B:=b;
print("line thro' points");
<<A[1, 2]*B[1, 3] - A[1, 3]*B[1, 2],-A[1, 1]*B[1, 3] + A[1, 3]*B[1, 1],A[1, 1]*B[1, 2] - A[1, 2]*B[1, 1]>>;
end proc,

 

proc(a::Matrix(3,1),b::Matrix(3,1))
option overload;
description "meet of lines";
local A:=a,B:=b;
print("intersect point");
<<A[2, 1]*B[3, 1] - A[3, 1]*B[2, 1] | -A[1, 1]*B[3, 1] + A[3, 1]*B[1, 1] | A[1, 1]*B[2, 1] - A[2, 1]*B[1, 1] >>;
end proc,

proc(A::{Matrix(1,3),Matrix(3,1)},B::{Matrix(1,3),Matrix(3,1)})
option overload;
description "incidence of point and line";
local dp;
uses LinearAlgebra;
if type(A,'Matrix'(1,3))and type(B,'Matrix'(3,1))   then
dp:=A[1, 1]*B[1, 1] + A[1, 2]*B[2, 1] + A[1, 3]*B[3, 1];

elif type(A,'Matrix'(3,1))and type(B,'Matrix'(1,3)) then
dp:=A[1, 1]*B[1, 1] + A[2, 1]*B[1, 2] + A[3, 1]*B[1, 3];

end if;
print("if = 0 coincident");
return dp
end proc,

proc(A::{Matrix(1,3),list})
option overload;
description "convert to/from cartesian";
if type(A,'Matrix'(1,3)) and A[1,3]<>0 then
[A[1,1]/A[1,3],A[1,2]/A[1,3]];
elif A::list then
<<A[1]|A[2]|1>>;
end if;
end proc,

proc(A::{Matrix(3,1)},{vars:=[x,y]})
option overload;
description "convert to expression";

A[1,1]*vars[1]+A[2,1]*vars[2]+A[3,1];

end proc
 

]):

p1:=<<1|2|4>>:p2:=<<3|-5|7>>:p3:=a*p1-b*p2:

L1:=<<5,7,-8>>:L2:=<<-1,4,-6>>:

L3:=ProjCp(p1,p2)

"line thro' points"

 

L3 := Matrix(3, 1, {(1, 1) = 34, (2, 1) = 5, (3, 1) = -11})

(17)

ProjCp(L1,L2)

"intersect point"

 

Matrix([[-10, 38, 27]])

(18)

ProjCp(p1,L3)

"if = 0 coincident"

 

0

(19)

ProjCp(L3,p1)

"if = 0 coincident"

 

0

(20)

ProjCp(ProjCp(p1,p2),p3)

"line thro' points"

 

"if = 0 coincident"

 

0

(21)

Cartlist:=ProjCp~([p1,p2,p3])

[[1/4, 1/2], [3/7, -5/7], [(a-3*b)/(4*a-7*b), (2*a+5*b)/(4*a-7*b)]]

(22)

ProjCp~(Cartlist)

[Matrix(1, 3, {(1, 1) = 1/4, (1, 2) = 1/2, (1, 3) = 1}), Matrix(1, 3, {(1, 1) = 3/7, (1, 2) = -5/7, (1, 3) = 1}), Matrix(1, 3, {(1, 1) = (a-3*b)/(4*a-7*b), (1, 2) = (2*a+5*b)/(4*a-7*b), (1, 3) = 1})]

(23)

ProjCp~([L1,L2,L3])

[5*x+7*y-8, -x+4*y-6, 34*x+5*y-11]

(24)

 

 

 

 

 

 

 


 

Download 2024-08-16_Projective_Vectors_as_Matrices.mw

What are the best techniques/tools/functions for rendering tabular data in more human-friendly ways within the Maple graphical user interface?

I work with large tables that would be too long to render completely in the interface, and doing so would not be an effective way to represent the data to readers of a Maple Document. However, rendering subsets of the data with headers, captions, colors, and footnotes would be beneficial. It would also be helpful to ensure each data type, such as dates, integers, and strings, was rendered appropriately. Ideally, the table would be rendered with sizing to fit the data rather than always the full width of the Maple Document.

Subsetting the data seems to be straightforward by indexing against the underlying variable. However, the operations available to define the rendering are unclear.

I see that the "Maple 2024 Help" includes documentation for "DocumentTools,Layout,Table." This appears to be the function to focus on specifically, and the DocumentTools Package seems to be the Package where control over layout is provided. Is this the only Package and Function to focus on, or are there alternative techniques?

There's no advanced search in the application center.

If I search for Maple 10 I get a total of 3 applications - I know there's at least a couple hundred maple 10 applications.  

How do I search for all Maple 10 applications?

Dear maple user i have a partial differential equation whose first approximation solution is w(r,z)=(r^2-h^2)/4 , i want to calculate the two approximations. I am attaching the file please see  

# I dont want to solve directly.

HP_Help.mw


 

restart

``

B := (sum(a__n*exp(n*x), n = -c .. p))/(sum(b__m*exp(m*x), m = -d .. q))

(exp((p+1)*x)/(exp(x)-1)-exp(-c*x)/(exp(x)-1))*a__n/((exp((q+1)*x)/(exp(x)-1)-exp(-d*x)/(exp(x)-1))*b__m)

(1)

 

NULL

Download open_series_and_take_derivative.mw

1 2 3 4 5 6 7 Last Page 2 of 344