Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I am presently working on bivariate functions defined this way

C := (u, v) -> (phi@@(-1))(phi(u)+phi(v));

phi is a function of specific expression named the "generator". Both u and v are assumed to be in the closed interval [0,1].

Here is an example:

restart
phi := u -> (u^(-theta)-1)/theta:
C := (u, v) -> (phi@@(-1))(phi(u)+phi(v)):
C(u, v)
                       / (-theta)        (-theta)    \
                      | u         - 1   v         - 1|
           @@(phi, -1)| ------------- + -------------|
                       \    theta           theta    /

This definition of C is correct providing that  theta in [-1, +infinity) \ {0}.
As you can see, the display of C(u, v) contains the inverse function phi@@(-1) which Maple doesn't seem to know what to do with.

What I would like is to get rid of  phi@@(-1) and get 

C(u, v);
        (-1+u^(-theta)+v^(-theta))^(-1/theta)

The only way I found to get this is to do that:

restart
phi := u -> (u^(-theta)-1)/theta:
(phi@@(-1)) := u -> solve(phi(x)=u, x): # explicit definition of (phi@@(-1))
C := (u, v) -> simplify((phi@@(-1))(phi(u)+phi(v))) assuming theta >= -1, theta <> 0:
C(u, v);
                                         /    1  \
                                         |- -----|
                                         \  theta/
             /      (-theta)    (-theta)\         
             \-1 + u         + v        /         

As you see I have been forced to tell Maple what the inverse function of phi was.
Is there another way do get this result without writting the bold red line?

Maple knows several inverse functions (trigonometric functions for instance), but how does it know that?
As Maple does not seem to use a (f@@(-1)) := u -> solve(f(x)=u, x) like definition, does it uses a correspondence table between functions and their inverse?
If it is so can we augment it?

Thanks in advance.

PS: the ultimate goal is to do something like this Download CAC.mw  for different generators.

For the moment I have defined my own table generator <--> inverse function  as I did above with the bold red line: this works but it is not very elegant.

Hi,
I have a problem and I haven't been able to solve it yet. I want to solve an ordinary diffrential equation similar to
                                                                                                   (dphi/dxi)^2+2*V(phi)=0
and plot phi versus xi for a the following conditions:
1) V(phi)=dphi/dxi=0 at (phi=0,phi_m) and
2) dV(phi)/dphi=0 at phi=phi_m and 
3) d^2V(phi)/dphi^2=0 at both phi=0 and phi=phi_m.
How can I do this by Maple?(see the attached file)
w1.mw

I tried

interface(warnlevel=0); infolevel[all]:=0;prinlevel:=0;kernelopts('printlevel'=0);

to suppress the warnings I get from this code

restart;
f:=z^3;
z_map:=proc(f,re,im) 
  if((re>0) and (im>0) and (im<1-re))then
    eval(f,z=re+I*im);
  else
    NULL;
  end if;
end proc;
p_re:=plots:-display(seq(plot([Re('z_map(f,re,im)'),Im('z_map(f,re,im)'),im=0..1]),re=0..10,0.1)):
p_im:=plots:-display(seq(plot([Re('z_map(f,re,im)'),Im('z_map(f,re,im)'),re=0..1]),im=0..10,0.1),color=green):
plots:-display(p_re,p_im,scaling=constrained)

The reason for the warnings is clear. The input lines are too long to be plotted. However, the resulting plot is exactly what I intended. Programatically truncating the lines would make the warning disappear, but it would make the code much more complicated.

What else can be done to suppress this kind of warning.

For Mathematica  math software app,there is a plugin to use in chatGPT pro ( paid subscription ) and maybe this can be done for Maple too ? 

Haven't used the plugin for Mathematica yet, am curious about it.
Let me have the AI look at the Riemann Hypothesis :)  
Have a few books on it, but can't get through that math with all those special functions.

i have two euations including integration which has two unkwnon x1 and x2.
how can i get these equations solved, thanks for the help.

restart:

with(DirectSearch)

[BoundedObjective, CompromiseProgramming, DataFit, ExponentialWeightedSum, GlobalOptima, GlobalSearch, Minimax, ModifiedTchebycheff, Search, SolveEquations, WeightedProduct, WeightedSum]

(1)

with(LinearAlgebra):

with(Student:-Calculus1):

with(Student:-NumericalAnalysis):

A:=convert(taylor(exp(Q),Q,6),polynom);

1+Q+(1/2)*Q^2+(1/6)*Q^3+(1/24)*Q^4+(1/120)*Q^5

(2)

Q:=a[11]*(E[r])^2+a[22]*(E[theta])^2+2*a[12]*E[r]*E[theta];

E[r]^2*a[11]+2*E[r]*E[theta]*a[12]+E[theta]^2*a[22]

(3)

psi:=0.5*c*(exp(Q)-1);

.5*c*(exp(E[r]^2*a[11]+2*E[r]*E[theta]*a[12]+E[theta]^2*a[22])-1)

(4)

F:=Matrix(3,3,[[lambda[r],0,0],[0,lambda[theta],0],[0,0,lambda[z]]]);

Matrix(3, 3, {(1, 1) = lambda[r], (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = lambda[theta], (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = lambda[z]})

(5)

sigma[r]:=-p+diff(psi,E[r])*F[1,1]^2;

-p+.5*c*(2*E[r]*a[11]+2*E[theta]*a[12])*exp(E[r]^2*a[11]+2*E[r]*E[theta]*a[12]+E[theta]^2*a[22])*lambda[r]^2

(6)

sigma[theta]:=-p+diff(psi,E[theta])*F[2,2]^2;

-p+.5*c*(2*E[r]*a[12]+2*E[theta]*a[22])*exp(E[r]^2*a[11]+2*E[r]*E[theta]*a[12]+E[theta]^2*a[22])*lambda[theta]^2

(7)

sigma[z]:=-p+diff(psi,E[z])*F[3,3]^2;

-p

(8)

p1:=diff(psi,E[r])*F[1,1]^2;#Pressure is constituted form 3 parts, one part is p1, other part is p2 and a constant p0

.5*c*(2*E[r]*a[11]+2*E[theta]*a[12])*exp(E[r]^2*a[11]+2*E[r]*E[theta]*a[12]+E[theta]^2*a[22])*lambda[r]^2

(9)

E[r]:=0.5*(lambda[r]^2-1);

.5*lambda[r]^2-.5

(10)

E[theta]:=0.5*(lambda[theta]^2-1);

.5*lambda[theta]^2-.5

(11)

E[z]:=0.5*(lambda[z]^2-1);

.5*lambda[z]^2-.5

(12)

lambda[r]:=x2*sqrt((r^2-x1)/x2)/r;

x2*((r^2-x1)/x2)^(1/2)/r

(13)

lambda[theta]:=r/sqrt((r^2-x1)/x2);

r/((r^2-x1)/x2)^(1/2)

(14)

lambda[z]:=1/x2;

1/x2

(15)

sigma[r];

-p+.5*c*(2*(.5*x2*(r^2-x1)/r^2-.5)*a[11]+2*(.5*r^2*x2/(r^2-x1)-.5)*a[12])*exp((.5*x2*(r^2-x1)/r^2-.5)^2*a[11]+2*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)*a[12]+(.5*r^2*x2/(r^2-x1)-.5)^2*a[22])*x2*(r^2-x1)/r^2

(16)

sigma[theta]:

sigma[z]:

#p2:=int((sigma[r]-sigma[theta])/r,r):%Pressure is constituted form 2 parts, one part is p1, other part is p2 and and a constant p0

Digits:=10:

c:=790000:

a[11]:=0.539:

a[22]:=0.368:

a[12]:=0.653:

p_in:=10000:

p_out:=0:

r_in:=5.4e-3:

r_out:=6.1e-3:

F_a:=0.381846:

p21:=(c/2)*(((r^2-x1)/r^3)-(x2*r/(r^2-x1)))*exp(Q);

395000*((r^2-x1)/r^3-x2*r/(r^2-x1))*exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)

(17)

p22:=(c/2)*Int(exp(Q)*(3*x2*r^6-r^6+5*x1*r^4-x1*x2*r^4-7*x1^2*r^2+3*x1^3)/(r^4*(r^2-x1)^2),r=r_in..r_out);#This is the part that should be maintained as an integral until the final solution

395000*(Int(exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)*(3*r^6*x2-r^6-r^4*x1*x2+5*r^4*x1-7*r^2*x1^2+3*x1^3)/(r^4*(r^2-x1)^2), r = 0.54e-2 .. 0.61e-2))

(18)

p2:=p21-p22;#p2 is computed using the integration by part method

395000*((r^2-x1)/r^3-x2*r/(r^2-x1))*exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)-395000*(Int(exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)*(3*r^6*x2-r^6-r^4*x1*x2+5*r^4*x1-7*r^2*x1^2+3*x1^3)/(r^4*(r^2-x1)^2), r = 0.54e-2 .. 0.61e-2))

(19)

 

p0:=(p_out+eval(p2,r=r_out));#p0 is the constant which is defined form the boundary conditions either p_out=subs(r=r_out,sigma[r]) or p_in=subs(r=r_in,sigma[r])

395000*(-4405655.099*x1+163.9344262-0.61e-2*x2/(-x1+0.3721e-4))*exp(.539*(13437.24805*x2*(-x1+0.3721e-4)-.5)^2+1.306*(13437.24805*x2*(-x1+0.3721e-4)-.5)*(0.18605e-4*x2/(-x1+0.3721e-4)-.5)+.368*(0.18605e-4*x2/(-x1+0.3721e-4)-.5)^2)-395000*(Int(exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)*(3*r^6*x2-r^6-r^4*x1*x2+5*r^4*x1-7*r^2*x1^2+3*x1^3)/(r^4*(r^2-x1)^2), r = 0.54e-2 .. 0.61e-2))

(20)

 

p:=p1+p2+p0;#p is the total pressure

395000.0*(.5390*x2*(r^2-x1)/r^2-1.1920+.6530*r^2*x2/(r^2-x1))*exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)*x2*(r^2-x1)/r^2+395000*((r^2-x1)/r^3-x2*r/(r^2-x1))*exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)-790000*(Int(exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)*(3*r^6*x2-r^6-r^4*x1*x2+5*r^4*x1-7*r^2*x1^2+3*x1^3)/(r^4*(r^2-x1)^2), r = 0.54e-2 .. 0.61e-2))+395000*(-4405655.099*x1+163.9344262-0.61e-2*x2/(-x1+0.3721e-4))*exp(.539*(13437.24805*x2*(-x1+0.3721e-4)-.5)^2+1.306*(13437.24805*x2*(-x1+0.3721e-4)-.5)*(0.18605e-4*x2/(-x1+0.3721e-4)-.5)+.368*(0.18605e-4*x2/(-x1+0.3721e-4)-.5)^2)

(21)

#p:=H+H00;

eq1:=Int((sigma[r]-sigma[theta])/r,r=r_in..r_out);

Int((395000.0*(.5390*x2*(r^2-x1)/r^2-1.1920+.6530*r^2*x2/(r^2-x1))*exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)*x2*(r^2-x1)/r^2-395000.0*(.6530*x2*(r^2-x1)/r^2-1.0210+.3680*r^2*x2/(r^2-x1))*exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)*r^2*x2/(r^2-x1))/r, r = 0.54e-2 .. 0.61e-2)

(22)

eq2:=Int(2*Pi*sigma[z]*r,r=r_in..r_out);

Int(2*Pi*(-395000.0*(.5390*x2*(r^2-x1)/r^2-1.1920+.6530*r^2*x2/(r^2-x1))*exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)*x2*(r^2-x1)/r^2-395000*((r^2-x1)/r^3-x2*r/(r^2-x1))*exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)+790000*(Int(exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)*(3*r^6*x2-r^6-r^4*x1*x2+5*r^4*x1-7*r^2*x1^2+3*x1^3)/(r^4*(r^2-x1)^2), r = 0.54e-2 .. 0.61e-2))-395000*(-4405655.099*x1+163.9344262-0.61e-2*x2/(-x1+0.3721e-4))*exp(.539*(13437.24805*x2*(-x1+0.3721e-4)-.5)^2+1.306*(13437.24805*x2*(-x1+0.3721e-4)-.5)*(0.18605e-4*x2/(-x1+0.3721e-4)-.5)+.368*(0.18605e-4*x2/(-x1+0.3721e-4)-.5)^2))*r, r = 0.54e-2 .. 0.61e-2)

(23)

#eq1:=Quadrature((sigma[r]-sigma[theta])/r,r=r_in..r_out,method=gaussian[5],output=value):

#eq2:=Quadrature(2*Pi*sigma[z]*r,r=r_in..r_out,method=gaussian[5],output=value):

eq1=evalf(p_out-p_in)

Int((395000.0*(.5390*x2*(r^2-x1)/r^2-1.1920+.6530*r^2*x2/(r^2-x1))*exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)*x2*(r^2-x1)/r^2-395000.0*(.6530*x2*(r^2-x1)/r^2-1.0210+.3680*r^2*x2/(r^2-x1))*exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)*r^2*x2/(r^2-x1))/r, r = 0.54e-2 .. 0.61e-2) = -10000.

(24)

eq2=F_a

Int(2*Pi*(-395000.0*(.5390*x2*(r^2-x1)/r^2-1.1920+.6530*r^2*x2/(r^2-x1))*exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)*x2*(r^2-x1)/r^2-395000*((r^2-x1)/r^3-x2*r/(r^2-x1))*exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)+790000*(Int(exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)*(3*r^6*x2-r^6-r^4*x1*x2+5*r^4*x1-7*r^2*x1^2+3*x1^3)/(r^4*(r^2-x1)^2), r = 0.54e-2 .. 0.61e-2))-395000*(-4405655.099*x1+163.9344262-0.61e-2*x2/(-x1+0.3721e-4))*exp(.539*(13437.24805*x2*(-x1+0.3721e-4)-.5)^2+1.306*(13437.24805*x2*(-x1+0.3721e-4)-.5)*(0.18605e-4*x2/(-x1+0.3721e-4)-.5)+.368*(0.18605e-4*x2/(-x1+0.3721e-4)-.5)^2))*r, r = 0.54e-2 .. 0.61e-2) = .381846

(25)

fsolve({eq1=evalf(p_out-p_in),eq2=F_a},{x1,x2});

fsolve({Int((395000.0*(.5390*x2*(r^2-x1)/r^2-1.1920+.6530*r^2*x2/(r^2-x1))*exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)*x2*(r^2-x1)/r^2-395000.0*(.6530*x2*(r^2-x1)/r^2-1.0210+.3680*r^2*x2/(r^2-x1))*exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)*r^2*x2/(r^2-x1))/r, r = 0.54e-2 .. 0.61e-2) = -10000., Int(2*Pi*(-395000.0*(.5390*x2*(r^2-x1)/r^2-1.1920+.6530*r^2*x2/(r^2-x1))*exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)*x2*(r^2-x1)/r^2-395000*((r^2-x1)/r^3-x2*r/(r^2-x1))*exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)+790000*(Int(exp(.539*(.5*x2*(r^2-x1)/r^2-.5)^2+1.306*(.5*x2*(r^2-x1)/r^2-.5)*(.5*r^2*x2/(r^2-x1)-.5)+.368*(.5*r^2*x2/(r^2-x1)-.5)^2)*(3*r^6*x2-r^6-r^4*x1*x2+5*r^4*x1-7*r^2*x1^2+3*x1^3)/(r^4*(r^2-x1)^2), r = 0.54e-2 .. 0.61e-2))-395000*(-4405655.099*x1+163.9344262-0.61e-2*x2/(-x1+0.3721e-4))*exp(.539*(13437.24805*x2*(-x1+0.3721e-4)-.5)^2+1.306*(13437.24805*x2*(-x1+0.3721e-4)-.5)*(0.18605e-4*x2/(-x1+0.3721e-4)-.5)+.368*(0.18605e-4*x2/(-x1+0.3721e-4)-.5)^2))*r, r = 0.54e-2 .. 0.61e-2) = .381846}, {x1, x2})

(26)

SolveEquations([eq1=evalf(p_out-p_in),eq2=F_a]);

Warning, objective function returns unfeasible value HFloat(undefined) for initial point [x1 = .9, x2 = .9]; trying to find a feasible initial point

 

Error, (in DirectSearch:-Search) cannot find feasible initial point; specify a new one

 

 

 

 

fsolve_problem.mw

For this integro-differential equation,

Equation:= int[y'(x)* (x^2)/[(x^2)-1],x)  =  (int[sqrt(y(x)])^(-2/3)

Maple is able to obtain an exact intrinsic solution

from which an exact solution can be extracted, namely,

ExtrinsicSolution:= y(x) = sqrt(3)*(-8*_C1*x^(8/3) + 12*x^2 - 3)^(3/4)

My question concerns how was this solution obtained.

Even more, specifically, 'odeadvisor' suggests converting the

equation in question to the form

ode:= y = G(x,diff(y(x),x));

However, I cannot reconcile how this can be applied to an equation which

contains two integrals. (Regretably, I am not able to directly, attach my

Maple worksheet directly on to this sheet). The situation is that after

applying 'dsolve' to the above 'Equation', Maple comes back with an

intrinsic solution which can was used to obtain the 'ExtrinsicSolution' in 

the above.  So it is the missing steps between applyingthe dsolve command

to Equation and the intrinsic solution which MS provides which, in turn, leads

to the 'Extrinsic Solution' above. I would greatly, appreciate if anyone can 

fill in the missing steps.

How to convert barycentric coordinates to cartesian ? Thank you

Is there a way to manipulate an equation so that it is in the form of (Expression of Primary Variables)*(Expression of Secondary Variables)
In the example below from Video 1: Fast Analytical Techniques for Electrical and Electronic Circuits (youtube.com), the primary variables are R1 and R2

PS. When I type ctrl-v to insert an image, I always get 2 copies.

I got the proportional symbol to work once, typing "proportional" + CRTL + Space.  Went for wlak came back and could not get it to work at all.

Does it actually work or am I imagining things?

Greetings All,

This is an application for control theory, specifially using Maple to solve control problems in the area of Interconnection and Damping Assignment Passivity Based Control (IDA-PBC).

- Assuming two variables (iL and Vo), there is a potential function that I am trying to solve for called "Ha".  I have two equations here, and I want to solve for Ha using the pdsolve() command:  

eq1 := diff(Ha(iL, Vo), iL) = rhs(result[1]);
eq2 := diff(Ha(iL, Vo), Vo) = rhs(result[2]);
pdsolve( {eq1, eq2  } );

Once I do this, Maple gives me an expression for Ha that has arbitrary functions in it (I understand where these are coming from).  So far, so good.

--> In order to get help solving for these arbitrary functions, I also want to tell Maple some constraints.  For example:

"the Hessian matrix of Ha must be positive definite"

Is there a way to do this?

Certainly a standard question.

I have an integer n*n matrix A (the entries are explicitly integers; there is no variable -type x- in the matrix). I want the Smith normal form of A, that is A=UDV where U,V are integer matrices with determinant +-1 and D is a diagonal matrix with -eventually- some zero and positive integers d_i s.t. d_i divides d_{i+1}.

"SmithForm()" doesn't work directly (I get rational -non integer- matrices). Maybe it is necessary to declare the matrix A as 'Matrix(integer)' ...
Thank you in advance for your help.

Has anybody been able to get Maple working on macOS Sonoma 14.4. I know it's not supported yet, but I thought there might be someone who has solved the issue with the app crashing immediately after startup.

point(A, xA, yA);
point(B, xB, yB);
point(C, xC, yC):
L3 := linestyle = 3
triangle(Tr, [A, B, C])
line(AP, [A, P]);
line(BP, [B, P]);
line(CP, [C, P]);
dr := draw([Tr(t3), AP(cbl, L3), BP(cbl, L3), CP(cbl, L3)]),
textplot([[coordinates(A)[], "A"], [coordinates(B)[], "B"], [coordinates(C)[], "C"]], align = {above, right});
display({dr, ellip}, scaling = constrained, axes = none, view = [-1 .. 14, -1 .. 11]);
Why doesn’t Maple show me the expected effect ? Thank you.

How do  I solve system of differential equations in finite difference method or finite element method?

eq1 := (diff(f(x), x, x, x))*(a*beta*f(x)^2-1)+(diff(f(x), x))^2-2*a*beta*f(x)*(diff(f(x), x))*(diff(f(x), x, x))+(diff(f(x), x))*(M+k[1])-(diff(f(x), x, x))*f(x)-(alpha*theta(x)+delta*phi(x))/rho = 0;

eq2 := -(diff(theta(x), x, x))*K[SB]*(Df-(Rd+k[hnf]/k[bf])/Pr)+N[t]*K[SB]*(diff(theta(x), x))^2-N[b]*(diff(theta(x), x))*(diff(phi(x), x))-(diff(f(x), x))*(diff(theta(x), x))-lambda*theta(x)-mu*Ec*(M*(diff(f(x), x))^2+(diff(f(x), x, x))^2) = 0;

eq3 := diff(phi(x), x, x)+Le*Sr*(diff(theta(x), x, x))+Le*f(x)*(diff(phi(x), x)) = 0;

ics := f(0) = 0, (D(f))(0) = 0, theta(0) = 1, phi(0) = 1;

bcs := (D(f))(100) = 0, theta(100) = 0, phi(100) = 0;


Parameters1 := rho = 2063.905, k[hnf] = .29942, k[bf] = .2520, mu = .38694, a = .1, beta = 5, k[1] = 2.0, M = 10, alpha = 20, delta = 20, K[SB] = .5, Df = 3, Pr = 1.2, Rd = 5, N[t] = 1.2, N[b] = 1.0, lambda = 1.5, Ec = 5, Le = .1, Sr = .1;

 


dS := -beta*S*Q;
dQ := Q*S*beta - Q*alpha;
dR := alpha*Q;
beta := 0.2;
alpha := 0.1;
S0 := 0.8;
Q0 := 0.2;
R0 := 0;
RungeKutta := proc(f::list, y0::list, t0::float, tf::float, h::float) local n, t, y, k1, k2, k3, k4, i; n := 1 + floor((tf - t0)/h); t := Vector(n, fill = 0); y := Matrix(n, length(y0), fill = 0); t[1] := t0; y[1] := Vector(y0); for i to n - 1 do k1 := Vector(map(f, t[i], y[i])); k2 := Vector(map(f, t[i] + 1/2*h, y[i] + 1/2*h*k1)); k3 := Vector(map(f, t[i] + 1/2*h, y[i] + 1/2*h*k2)); k4 := Vector(map(f, t[i] + h, y[i] + h*k3)); y[i + 1] := y[i] + 1/6*h*(k1 + 2*k2 + 2*k3 + k4); t[i + 1] := t[i] + h; end do; [t, y]; end proc;
f = [dS, dQ, dR];
t0 := 0;
tf := 50;
h := 0.1;
result := RungeKutta(f, [S0, Q0, R0], t0, tf, h);
t_values := result[1];
S_values := result[2][() .. (), 1];
Q_values := result[2][() .. (), 2];
R_values := result[2][() .. (), 3];
plots:-display(plot(t_values, S_values, color = "blue", legend = "Susceptible"), plot(t_values, Q_values, color = "red", legend = "Infected"), plot(t_values, R_values, color = "green", legend = "Recovered"), legend = ["Susceptible", "Infected", "Recovered"], title = "Simulation of Infectious Disease Model", xlabel = "Time", ylabel = "Population", view = [0 .. tf, 0 .. 1]);
Warning, (in RungeKutta) `i` is implicitly declared local
                         dS := -0.2 S Q

                     dQ := 0.2 S Q - 0.1 Q

                          dR := 0.1 Q

                          beta := 0.2

                          alpha := 0.1

                           S0 := 0.8

                           Q0 := 0.2

                            R0 := 0

RungeKutta := proc (f::list, y0::list, t0::float, tf::float, 

   h::float) local n, t, y, k1, k2, k3, k4, i; n := 1+floor((tf-\

  t0)/h); t := Vector(n, fill = 0); y := Matrix(n, length(y0), 

   fill = 0); t[1] := t0; y[1] := Vector(y0); for i to n-1 do 

   k1 := Vector(map(f, t[i], y[i])); k2 := Vector(map(f, 

   t[i]+(1/2)*h, y[i]+(1/2)*h*k1)); k3 := Vector(map(f, 

   t[i]+(1/2)*h, y[i]+(1/2)*h*k2)); k4 := Vector(map(f, t[i]+h, 

   y[i]+h*k3)); y[i+1] := y[i]+(1/6)*h*(k1+2*k2+2*k3+k4); 

   t[i+1] := t[i]+h end do; [t, y] end proc


[-0.2 S Q, 0.2 S Q - 0.1 Q, 0.1 Q] = [-0.2 S Q, 0.2 S Q - 0.1 Q, 

  0.1 Q]


                            t0 := 0

                            tf := 50

                            h := 0.1

Error, invalid input: RungeKutta expects its 3rd argument, t0, to be of type float, but received 0
                     t_values := result[1]

               S_values := result[2][() .. (), 1]

               Q_values := result[2][() .. (), 2]

               R_values := result[2][() .. (), 3]

Warning, expecting only range variable result[2][(NULL) .. (NULL),1] in expression result[1] to be plotted but found name result[1]
Warning, expecting only range variable result[2][(NULL) .. (NULL),2] in expression result[1] to be plotted but found name result[1]
Warning, expecting only range variable result[2][(NULL) .. (NULL),3] in expression result[1] to be plotted but found name result[1]
Error, (in plots:-display) unexpected options: [xlabel = "Time", ylabel = "Population"]

First 18 19 20 21 22 23 24 Last Page 20 of 2174