Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

What maple command returns the condition number of a matrix?

I have this problem with this system of equations, when I solve the 13x13 system it does not give me any solution, neither giving seed values ​​nor placing full digits. The exercise is solved and I tried to assume close values ​​and it doesn't work for me, it leaves everything expressed with the fsolve command.

Download p1.mw

I want to simplify the attached expression by applying the relation \( k_1 + k_2 + k_3 = 0 \).

For instance, the terms \( k_3 + k_1 - k_2 \) become \(-2k_2\) and \( k_1 + k_2 - k_3 \) become \(-2k_3\), etc.

Instead of manually changing each term, I am looking for a systematic method to apply this relation to simplify the given expression.

aabb.mw

How to simplify the expression where each vectors k_i and q has real components, i.e., etc

Only W_i, U_i,j, V_i,j are complex numbers, so conjugate (bar) is applicable for them. How to make declaration, so that all other bars are removed and simplify the expression.

aa.mw

while running my code i am not able to edit it. when i close my file and re open it then it is edit able but only once after that to re edit i have to run it again.
one more query i am facing is that i have made whole code now i just want to change pde and exact solution of that pde to get different solutions of pde although my code is working for one pde but while changing pde it is giving me error why?
and some times it takes alot of time to evaluate is there any error in the code or should i change my laptop?

kindly help me with all these queries.

Sq := proc(n::integer)
local aS, oS, aC, oC, s, dr, pc, u;
aS := -i/n;
oS := sum(1/s, s = 1 .. n);
aC := 1/2*aS;
oC := oS - 1/2*1/((n + 1)*n);
point(S, aS, oS); point(C, aC, oC);
MakeSquare(K, [S, 'center' = C]);
u := (x, i) -> sum(exp(-x*k)/k, k = 1 .. i);
pc := plot(u(x, n), x = 0 .. 4, color = green);
dr := draw([K]);
display({dr, pc});
end ;Sq(1);
Error, (in geometry:-draw) non-numeric coordinate encountered, cannot determine plot view
How to correct this procedure ?

I have used alias for various reasons inside a pagkage. It is useful for coupling old command names to modern ones.

I am trying now to get this to work inside a sub package but no success. Can this be done?

restart

 

pkg:=module()
option package;
export   Sqr, UHG;
alias(XX=Sqr);
#alias(eparm=CirclePramUHG);
Sqr:=proc(x)
   return x^2;
end proc;

 UHG:=module()
          option package;
         
          export
               CircleParmUHG;

alias(eparm=CirclePramUHG);

     CircleParmUHG := proc(T::algebraic, U::algebraic)
       local t, u, P, cp;
         #  P := point;
             t := T*denom(T)*denom(U);
             u := U*denom(T)*denom(U);
         # if P <> NullPoint then
         #   P := 'NullLine';
         #end if;
        if t::numeric and u::numeric and t<>0 and u<>0 then
             cp:=  <u^2 - t^2| 2*u*t| u^2 + t^2>/gcd(gcd(u^2 - t^2, 2*u*t), u^2 + t^2);
          else
             cp:=  <u^2 - t^2| 2*u*t| u^2 + t^2>;
        end if;
        return cp
      end proc;
    end module;
end module;

_m2044017012448

(1)

with(pkg)

[Sqr, UHG]

(2)

Sqr(4)

16

(3)

UHG:-CircleParmUHG(t,u)

[`?`]

(4)

UHG:-eparm(t,u)

Error, eparm is not a command in the pkg:-UHG package

 

with(UHG)

[CircleParmUHG]

(5)

CircleParmUHG(2,7)

Vector[row]([45, 28, 53])

(6)

eparm(2,7)

eparm(2, 7)

(7)

 

XX(3)

9

(8)
 

 

Download 2024-06-29_use_alias_in_a_Sub_Package.mw

Maple formats output depending on typesetting options "extened" and "standard" for the GUI (or interface). An example taken from

restart;
ts_standard:=proc(k::anything)
     interface(typesetting=standard):
     print(k);
     interface(typesetting=extended): 
     NULL;
end proc:
k:=3/8*ln(55/52)+sin(x)+3/4*exp(x);
                    3   /55\            3       
               k := - ln|--| + sin(x) + - exp(x)
                    8   \52/            4       

ts_standard(k);
                               

Why is the input two times returned and why one time as a list?
Somehow the first interface statement is responsible for that.

I am only interested in the reformated input inside the list.
Is it possible to fix the code?

Other observation with typesetting=standard:

restart;
interface(typesetting=standard);
expr:=cos(x)^2;
((x->x)=combine[trig])(expr);
                      

((x->x)=combine[trig])(expr);#subsequent call
                          2   1            1
                    cos(x)  = - cos(2 x) + -
                              2            2

(with Maple 2024.1 this only accurs in Math-1D)
but

restart;
expr:=cos(x)^2;
interface(typesetting=standard);
((x->x)=combine[trig])(expr);
                                      2
                        expr := cos(x) 

                            extended

                          2   1            1
                    cos(x)  = - cos(2 x) + -
                              2            2

I need to check inside typeset to see is something evaluates to 1. I can find if something contains 1 and have been using that. But got caught out last night because I forgot my work around. e.g. 1+H contains 1 and my work around is `1+H` so the check doesn't see the 1. The typeset is always the first item in the list.

restart

 

 

foo:=proc(a,{S::list:=[]})
local i,perp::boolean;
if S<>NULL then
  if (S[1])=1 or S[1]::function and has(`or`(seq (op(S[1]),i=1..nops([op(S[1])]))),1)  then
   #if (S[1])=1 or S[1]::function and `or`(seq (is(op(S[1][i]),1),i=1..nops([op(S[1])])))  then  ;#  not working
   
     perp:=true;print(perp);
    else
     perp:=false;print(perp);
  end if;
end if;
end proc:

foo(6,S=["cat"]);

 

false

(1)

foo(6,S=[1]);

true

(2)

foo(6,S=[typeset("cat=",H/H),align={above,left},color=green]); #good

true

(3)

foo(6,S=[typeset("cat=",H),align={above,left}])

false

(4)

foo(6,S=[typeset("cat=",1+H)],align={above,left},color=green);#want to fix this

 

 

true

(5)

foo(6,S=[typeset("cat=",`1+H`)]); #work around

false

(6)

foo(6,S=[typeset("cat=",`B/(H+1)`)]); #work around

false

(7)

foo(6,S=[typeset("cat=",`B/(H+1)`,"  height =",1)]); #correct

true

(8)

foo(6,S=[typeset("cat=",H^2/((2*H-H)*H),"  height =",`B/(H+1)`)]); #correct

true

(9)

op(typeset("cat=",B/(H+1)));# this would be false

 

"cat=", B/(1+H)

(10)

op(typeset("cat=",H^2/((2*H-H)*H),"  height =",`B/(H+1)`)) ;  # this would be true

 

 

"cat=", 1, "  height =", `B/(H+1)`

(11)
 

 

Download 2024-06-27_Q_check_inside_typeset.mw

When the limit approaches from left, the result must be zero. What cause the wrong? Will introducing an extra parameter M affect the result in W1?

W := -1/2+(1/2)*tanh(3.6*(tan(Pi*(r-2.1)/(2*7.9))-.6^2/tan(Pi*(r-2.1)/(2*7.9)))/Pi)

-1/2+(1/2)*tanh(1.145915590*tan(.1988349781*r-.4175534540)-.4125296124/tan(.1988349781*r-.4175534540))

(1)

limit(W, r = 10, left)

-1.000000000

(2)

W1 := -1/2+(1/2)*tanh(3.6*(tan(Pi*(r-2.1*M)/((2*7.9)*M))-.6^2/tan(Pi*(r-2.1*M)/((2*7.9)*M)))/Pi)

-1/2+(1/2)*tanh(1.145915590*tan(.1988349781*(r-2.1*M)/M)-.4125296124/tan(.1988349781*(r-2.1*M)/M))

(3)

limit(W1, r = 10*M, left)

-1.000000000

(4)

NULL

Download limit.mwlimit.mw

I want to write  in maple using summation notation for symbolic calculation. The output should come as 

 

W_1exp(k_1.q)+W_2exp(k_2.q)+W_3exp(k_3.q)

where k_j.q are the dot product of the vectors k_j and q. 

mp.mw

How to do this. Please help. The summation is not working for me, only suffix k is coming  

Is there a way to define tensor components without addressing each component individually? Suppose I define a tensor A[a, mu], where Latin letters are space coordinates and Greek letters are space-time coordinates. Is there an easy way to define multiple components without having to define each component separately. For example, A[a,0] = 0 and A[a,i] = LeviCevita[a,i,j].

restart;
with(Physics);
Setup(spaceindices = lowercaselatin_ah)
g_[]
Define(A[a, mu])
A[a, 1] := 0
A[a, b] := LeviCivita[a, b, c]
TensorArray(A[a, mu]) 
A[1, 2] := 0
A[2, 3] := LeviCivita[2, 3, c]
TensorArray(A[a, mu])

The general writing method does not seem to change the tensor components, but the writing method in which I address the components individually does. What exactly am I doing wrong? 

I use convert~([points1], list) command but the outcome is not I want. The code of shortscreen is attached. I wanna change the outermost curly braces of the sequence "points1" into square brackets. Thank you all guys to answer!

The below is I want.

This is not I want cause the outermost has three square brackets! I just wanna two.

GUI state after interupting with :

After switching to untitled 17 and back to test_timeout:

Sometimes it is necessary to switch back and forth twice.

Does this mean that the kernel did not receive the interupt?

eqn := B(n) = -sum(binomial(n + 1, k)*B(k), k = 0 .. n - 1)/(n + 1);
init := B(0) = 1, B(1) = -1/2;
sol := rsolve({eqn, init}, B(n));
Why doesn’t this give me any solution ? Thank you.

First 94 95 96 97 98 99 100 Last Page 96 of 2216