Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I want to perform a numerical evaluation of sums of integrals of relatively complicated functions. I know about the evalf(Int( )) and evalf(Sum( )) commands to numerically evaluate both sums and integrals individually. My question is: what is the time-efficient way to numerically evaluate a sum of integrals? 

Here is a simplified sketch of what I have.

Say I define my complicated function F of the variable x (which will be integrated over) and of some constant parameter n.

I am interested in numerically evaluating in a time efficient way the following sum of integrals of F:

Where should I apply the evalf() command(s)? Should I go evalf(Sum( evalf(Int( )))) or evalf(Sum( Int())) or sum( evalf(Int( ))), or something else? I am not too worried about the accuracy here: it is for plots mainly. How to make this numercal evaluation fast?

Bonus question. If now I make F also depend on t, and wish to define a function G(t) out of a linear combination of such sums of integrals: is the method the same? I can have G(t) defined numerically with a t dependance. For example:

Thanks a lot!

PS: F is a complicated function in the sense that it is rationnal in some (non-usual) polynomials defined by a Rodrigues Rormula. The integrand has no singularity on the domain of integration. I have Maple 2018.

complexplot3d((z - 1)/(z^2 + z + 1), z = -4 - 4*I .. 4 + 4*I, view = [-2 .. 2, -2 .. 2, 0 .. 2], grid = [70, 70], shading = zhue)

How can I change this color of complex plot to take mirror image of my enhanced portrait? I see this is inverse but I don't know the source of this situation. I guess that zhue is indicaded by H = arg(f(z)) L = l(|f(z)|) S=1 in MAPLE but I don't know how to transfer and change this to the second picture coloring. I built the code for the second picture using codes from this post:

https://www.mapleprimes.com/questions/226790-Is-There-Any-Maple-Code-For-The-domain

 

I want to present this complexplot with the same coloring so thank for all yours advise.

Dear Users!

Hope everyone is fine here. I want to formulate the table like give bellow (Table 5.17) in maple so that I can copy it in word file and can edit.

The values of y[1,1],y[2,1],y[2,2],y[3,1],y[3,2],y[3,3]...y[nops(HAq),nops(HAq)] present in the following maple code. Thanks in advance

Refine_Extrapolation.mw

I'm a bit confused about set ordering.

According to help there are those features

  1. object id (same kind of data-structures to be grouped togther)
  2. object length
  3. lexicographical or numerical orders
  4. recurse on components
  5. address

Have a look at the following set.

  • If object length has higher priority than lexicographical order, why is HBSEVO before LBS?
  • If lexicographical order has higher priority, which is HBSPLATEEVO after VGZEVO?

Download SetSortOrder.mw

restart;
T := diff(Phi(xi), xi);
                           d          
                          ---- Phi(xi)
                           dxi        
restart;
T := (p*a^(-Phi(xi))+q+r*a^Phi(xi))/ln(a);
                    (-Phi(xi))          Phi(xi)
                 p a           + q + r a       
                 ------------------------------
                             ln(a)             
u[0] := C[0]+C[1]*a^Phi(xi)+C[2]*a^(2*Phi(xi));
                         Phi(xi)         (2 Phi(xi))
            C[0] + C[1] a        + C[2] a           
u[1] := diff(u[0], xi);
               Phi(xi) / d          \      
         C[1] a        |---- Phi(xi)| ln(a)
                       \ dxi        /      

                      (2 Phi(xi)) / d          \      
            + 2 C[2] a            |---- Phi(xi)| ln(a)
                                  \ dxi        /      
d[1] := C[1]*a^Phi(xi)*T*ln(a)+2*C[2]*a^(2*Phi(xi))*T*ln(a);
         Phi(xi) /   (-Phi(xi))          Phi(xi)\
   C[1] a        \p a           + q + r a       /

                (2 Phi(xi)) /   (-Phi(xi))          Phi(xi)\
      + 2 C[2] a            \p a           + q + r a       /
u[2] := diff(d[1], xi);
      Phi(xi) / d          \       /   (-Phi(xi))    
C[1] a        |---- Phi(xi)| ln(a) \p a           + q
              \ dxi        /                         

        Phi(xi)\         Phi(xi) /
   + r a       / + C[1] a        |
                                 \
    (-Phi(xi)) / d          \      
-p a           |---- Phi(xi)| ln(a)
               \ dxi        /      

        Phi(xi) / d          \      \           (2 Phi(xi)) / d  
   + r a        |---- Phi(xi)| ln(a)| + 4 C[2] a            |----
                \ dxi        /      /                       \ dxi

          \       /   (-Phi(xi))          Phi(xi)\          
   Phi(xi)| ln(a) \p a           + q + r a       / + 2 C[2] 
          /                                                 

   (2 Phi(xi)) /    (-Phi(xi)) / d          \      
  a            |-p a           |---- Phi(xi)| ln(a)
               \               \ dxi        /      

        Phi(xi) / d          \      \
   + r a        |---- Phi(xi)| ln(a)|
                \ dxi        /      /
d[2] := C[1]*a^Phi(xi)*T*ln(a)*(p*a^(-Phi(xi))+q+r*a^Phi(xi))+C[1]*a^Phi(xi)*(-p*a^(-Phi(xi))*T*ln(a)+r*a^Phi(xi)*T*ln(a))+4*C[2]*a^(2*Phi(xi))*T*ln(a)*(p*a^(-Phi(xi))+q+r*a^Phi(xi))+2*C[2]*a^(2*Phi(xi))*(-p*a^(-Phi(xi))*T*ln(a)+r*a^Phi(xi)*T*ln(a));
                                              2                  
      Phi(xi) /   (-Phi(xi))          Phi(xi)\          Phi(xi) /
C[1] a        \p a           + q + r a       /  + C[1] a        \
    (-Phi(xi)) /   (-Phi(xi))          Phi(xi)\
-p a           \p a           + q + r a       /

        Phi(xi) /   (-Phi(xi))          Phi(xi)\\
   + r a        \p a           + q + r a       //

                                                         2       
             (2 Phi(xi)) /   (-Phi(xi))          Phi(xi)\        
   + 4 C[2] a            \p a           + q + r a       /  + 2 C[

      (2 Phi(xi)) /
  2] a            \
    (-Phi(xi)) /   (-Phi(xi))          Phi(xi)\
-p a           \p a           + q + r a       /

        Phi(xi) /   (-Phi(xi))          Phi(xi)\\
   + r a        \p a           + q + r a       //
expand((2*k*k)*w*beta*d[2]-(2*alpha*k*k)*d[1]-2*w*u[0]+k*u[0]*u[0]);
          2                         Phi(xi)
-2 alpha k  C[1] p + 2 k C[0] C[1] a       

                             2                      3     
                   / Phi(xi)\             / Phi(xi)\      
   + 2 k C[0] C[2] \a       /  + 2 k C[1] \a       /  C[2]

                      2             Phi(xi)
   - 2 w C[0] + k C[0]  - 2 w C[1] a       

                        2                     2
              / Phi(xi)\          2 / Phi(xi)\ 
   - 2 w C[2] \a       /  + k C[1]  \a       / 

                       4                                
           2 / Phi(xi)\       2              Phi(xi)    
   + k C[2]  \a       /  + 4 k  w beta C[1] a        p r

                                2    
        2             / Phi(xi)\     
   + 6 k  w beta C[1] \a       /  q r

         2              Phi(xi)    
   + 12 k  w beta C[2] a        p q

                                 2    
         2             / Phi(xi)\     
   + 16 k  w beta C[2] \a       /  p r

                                 3                          
         2             / Phi(xi)\           2              2
   + 20 k  w beta C[2] \a       /  q r + 4 k  w beta C[2] p 

                                                            2  
              2       Phi(xi)              2      / Phi(xi)\   
   - 2 alpha k  C[1] a        q - 2 alpha k  C[1] \a       /  r

                                                            2  
              2       Phi(xi)              2      / Phi(xi)\   
   - 4 alpha k  C[2] a        p - 4 alpha k  C[2] \a       /  q

                               3                         
              2      / Phi(xi)\         2                
   - 4 alpha k  C[2] \a       /  r + 2 k  w beta C[1] p q

        2              Phi(xi)  2
   + 2 k  w beta C[1] a        q 

                                3   
        2             / Phi(xi)\   2
   + 4 k  w beta C[1] \a       /  r 

                                2   
        2             / Phi(xi)\   2
   + 8 k  w beta C[2] \a       /  q 

                                 4   
         2             / Phi(xi)\   2
   + 12 k  w beta C[2] \a       /  r 
value(%);
          2                         Phi(xi)
-2 alpha k  C[1] p + 2 k C[0] C[1] a       

                             2                      3     
                   / Phi(xi)\             / Phi(xi)\      
   + 2 k C[0] C[2] \a       /  + 2 k C[1] \a       /  C[2]

                      2             Phi(xi)
   - 2 w C[0] + k C[0]  - 2 w C[1] a       

                        2                     2
              / Phi(xi)\          2 / Phi(xi)\ 
   - 2 w C[2] \a       /  + k C[1]  \a       / 

                       4                                
           2 / Phi(xi)\       2              Phi(xi)    
   + k C[2]  \a       /  + 4 k  w beta C[1] a        p r

                                2    
        2             / Phi(xi)\     
   + 6 k  w beta C[1] \a       /  q r

         2              Phi(xi)    
   + 12 k  w beta C[2] a        p q

                                 2    
         2             / Phi(xi)\     
   + 16 k  w beta C[2] \a       /  p r

                                 3                          
         2             / Phi(xi)\           2              2
   + 20 k  w beta C[2] \a       /  q r + 4 k  w beta C[2] p 

                                                            2  
              2       Phi(xi)              2      / Phi(xi)\   
   - 2 alpha k  C[1] a        q - 2 alpha k  C[1] \a       /  r

                                                            2  
              2       Phi(xi)              2      / Phi(xi)\   
   - 4 alpha k  C[2] a        p - 4 alpha k  C[2] \a       /  q

                               3                         
              2      / Phi(xi)\         2                
   - 4 alpha k  C[2] \a       /  r + 2 k  w beta C[1] p q

        2              Phi(xi)  2
   + 2 k  w beta C[1] a        q 

                                3   
        2             / Phi(xi)\   2
   + 4 k  w beta C[1] \a       /  r 

                                2   
        2             / Phi(xi)\   2
   + 8 k  w beta C[2] \a       /  q 

                                 4   
         2             / Phi(xi)\   2
   + 12 k  w beta C[2] \a       /  r 
simplify(%);
           2                         Phi(xi)
 -2 alpha k  C[1] p + 2 k C[0] C[1] a       

                     (2 Phi(xi))             (3 Phi(xi))     
    + 2 k C[0] C[2] a            + 2 k C[1] a            C[2]

                (2 Phi(xi))         2  (2 Phi(xi))
    - 2 w C[2] a            + k C[1]  a           

            2  (4 Phi(xi))            2       (2 Phi(xi))  
    + k C[2]  a            - 2 alpha k  C[1] a            r

               2       (2 Phi(xi))  
    - 4 alpha k  C[2] a            q

               2       (3 Phi(xi))                      2
    - 4 alpha k  C[2] a            r - 2 w C[0] + k C[0] 

                Phi(xi)      2              (2 Phi(xi))    
    - 2 w C[1] a        + 6 k  w beta C[1] a            q r

          2              (2 Phi(xi))    
    + 16 k  w beta C[2] a            p r

          2              (3 Phi(xi))    
    + 20 k  w beta C[2] a            q r

         2              Phi(xi)    
    + 4 k  w beta C[1] a        p r

          2              Phi(xi)          2              2
    + 12 k  w beta C[2] a        p q + 4 k  w beta C[2] p 

               2       Phi(xi)              2       Phi(xi)  
    - 2 alpha k  C[1] a        q - 4 alpha k  C[2] a        p

         2              (3 Phi(xi))  2
    + 4 k  w beta C[1] a            r 

         2              (2 Phi(xi))  2
    + 8 k  w beta C[2] a            q 

          2              (4 Phi(xi))  2      2                
    + 12 k  w beta C[2] a            r  + 2 k  w beta C[1] p q

         2              Phi(xi)  2
    + 2 k  w beta C[1] a        q 
collect(%, a^Phi(xi));
Error, (in collect) cannot collect a^Phi(xi)
 

Is it possible to auto close brackets in Maple? Like when I type "sin(pi" it would automatically create a closing bracket and I could just press enter to calculate

I am trying to find Lie subalgebra for finding optimal solutions directly with the help of MAPLE.  Please help me to find it. Share MAPLE code please.

Any good online training for maple soft to purchase 

How to solve this differential equation numerically

eq:=diff(f(tau), tau) =Af(tau) +Lf(tau) +C+Bf(tau)

Hello everyone, I am very new to Maple so please bear with me. I have created a procuedure that rearranges 

NaturalNumbers:=proc(k)
[$1..2*k-1]
end proc;

Into 

eq_arrangement:=proc(k)  local i,j,a;  for i from 1 to k-1 do 
  a[2*i-1]:=k+i; 
  a[2*i]:=k-i; 
end do:
[k,seq(a[j],j=1..2*(k-1))];end proc; 

 

My question is how I can repeat this procudure the sufficient number of times until I get back to [$1..2*k-1] in that order. 

 

Thank you so much!

 

 

Hi,

I'm trying to plot the function below. However, I cannot get the plot to exceed 10 on the x-axis. I have tried changing the axis properties but the function is just "cut off". I have had the same problem with similar functions and ended up using other software.

The function should have valid values above 10.

 

Does anyone know how I can fix this?

h := x -> 1.23 + x*1*0.0001 + 0.12*log(50000*x) + abs((-1)*0.03*log(x/0.001))

Thank you in advance :)

Hello, dear All

I have Maple2021 installed and I'll use the newest Physics Version. But
it does not work.

How can I activate the Physic Version 935?

When I start the file: "Wirtinger_Derivatives.mw"  I get

With kind regards

Wolfgang Gellien
 

I have found few PDE's so far  that timeout in Maple 2021 which did not do that in Maple 2020.2. Using same amount of time out, on same PC.

After some debugging, I found that that cause is calling latex:-Settings(....) before calling  timelimit(pdsolve(...))  causes the timeout.

At first, I thought this must be coincidence. Why would calling latex make pdsolve timeout?

So I tried again and again and again. Each time, removing the call to latex makes pdsolve not time out. Putting latex call back in, now pdsolve times out. Each time restart is always called (in new cell) before.

The timeout is 10 minutes.  Without latex called before, pdsolve took about about 5 minutes on my PC to solve the PDE.  

Any one could see if they can reproduce this?

Why would calling latex:-Settings(....)  causes pdsolve now use all 10 minutes and then timeout? This is very strange.

Maple 2021. Latex Physics package. Windows 10.

attached is worksheet showing this with many tries.

restart;
latex:-Settings(UseImaginaryUnit=i,
      UseColor = false,
      powersoftrigonometricfunctions= mixed, ## computernotation,
      leavespaceafterfunctionname = true,
      cacheresults = false,
      spaceaftersqrt = true  
);

pde :=  a*ln(lambda*x)^n*diff(w(x,y),x)+ b*ln(mu*x)^m*diff(w(x,y),y) = c*ln(nu*x)^k*w(x,y)+p*ln(beta*y)^s+q;
timelimit(60*10,pdsolve(pde,w(x,y)));

#Error, (in expand) time expired
#OR 
#Error, (in evala/Divide/heuristic) time expired


restart;
pde :=  a*ln(lambda*x)^n*diff(w(x,y),x)+ b*ln(mu*x)^m*diff(w(x,y),y) = c*ln(nu*x)^k*w(x,y)+p*ln(beta*y)^s+q;
timelimit(60*10,pdsolve(pde,w(x,y)));

#no problem solution found.

 

why_time_out_with_latex_march_23_2021.mw


I can't understand how to use Optimization in Operator Form when the objective function relies upon the numerical solution of a parameterized ODE.

Here is a very simple example :

  • I have a differential system that can be solved only numerically (so do not focus on the system I give to reply that I could solve it formally, I know that and the example is notional)
  • This system contains free parameters (K and M in my example) and an event whose firing time T I want to capture. 
  • The goal is to find what is the maximum value of T when K and M both belong to bounded ranges.
     
  • In the example I implicitely assumed that the event is fired for any (K, M) in their admissible ranges: this is a quite restrictive assumption that I will manage later.
restart:
sys := { M*diff(x(t), t$2)=t-K*x(t), x(0)=0, D(x)(0)=0};
evs := [[x(t)-5, halt]];

sol := dsolve(sys, numeric, events=evs, parameters=[K, M]):
interface(warnlevel=0):

TV := proc(P)
  sol(parameters=P):
  sol(10):
  return sol(eventfired=[1])[];
end proc:

# verification
TV([1$2])
                   HFloat(4.152620782382694)

# what I'm interested in
ranges := P[1]=0.8..1.2, P[2]=0.8..1.2:
Optimization:-NLPSolve(TV, ranges);
Error, (in Optimization:-NLPSolve) unexpected parameters: P[1] = .8 .. 1.2, P[2] = .8 .. 1.2

# another way
cstr := {0.8 < P[1], 1.2 > P[1], 0.8 < P[2], 1.2 > P[2]}:
Optimization:-Maximize(TV, cstr);
Error, (in Optimization:-NLPSolve) constraints must be specified as a set or list of  procedures


optim_parametric_dsolve.mw


I'm using both Maple 2015 and Maple 2020 and would appreciate an answer which fits these two versions.
Could you help me solve this issue?

TIA

First 299 300 301 302 303 304 305 Last Page 301 of 2097