Unanswered Questions

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

Why won't this procedure Compile? All I get is a cryptic and ungrammatical error message.

    step:= proc(
          n::integer[4],
          XYZ::Matrix(datatype= float[8]),
          E::Vector(datatype=integer[4]), F::Vector(datatype=integer[4]),
          W::Matrix(datatype= float[8]), #3x2 scratch matrix
          mu::integer[4]
     )
     option autocompile;
     local
          i::integer[4], j::integer[4],
          ed::float[8],
          fd::float[8],
          p::float[8], t::float[8]       
     ;
          to mu do
               for i to n do
                    ed:= 0;  fd:= 0;
                    for j to 3 do
                          p:= XYZ[i,j];
                          t:= XYZ[E[i],j] - p;
                          ed:= ed+t^2;
                          W[j,1]:= t;
                          t:= XYZ[F[i],j] - p;
                          fd:= fd+t^2;
                          W[j,2]:= t
                    od;
                    ed:= sqrt(ed) + .01;  fd:= sqrt(fd) + .01;
                    for j to 3 do
                         XYZ[i,j]:= 0.995*XYZ[i,j] - 0.01*W[j,1]/ed + 0.02*W[j,2]/fd
                    od
               od
          od
     end proc;
Compiler:-Compile(step);

Error, (in Compiler:-Compile1) In memory compilation failed

Hello guys,

I was just playing around with the Shanks transformation of a power series, when I noticed that polynomials aren't evaluated as I would expect.
I created this minimal working example; the function s should evaluate for z=0 to a[0], however it return simply 0.
Is there something I messed up?

restart

s := proc (n, z) options operator, arrow; sum(a[k]*z^k, k = 0 .. n) end proc;

proc (n, z) options operator, arrow; sum(a[k]*z^k, k = 0 .. n) end proc

(1)

series(s(n, z), z = 0)

series(a[0]+a[1]*z+a[2]*z^2+a[3]*z^3+a[4]*z^4+a[5]*z^5+O(z^6),z,6)

(2)

The value of s in z=0 should be a[0], however it returns 0:

s(n, 0)

0

(3)

s(1, 0)

0

(4)

Download evaluate_sum.mw

 

Thanks for your help,

Sören

 

Hi all,

 

It is believeble for me that the KummerU function is infinite or has a singular solution at r=0;

but without the command D(R) and dsolve ({er, D(R)(0)=0}, {R(r)}) that show the r=0 is a singular solution for the R(r), how could I prove it without using of these commands: for example is plotting of this function applicable??

while we have not the value of the  \lambda

````

restart

eq := diff(R(r), r, r)+(diff(R(r), r))/r+(-r^2+1)*lambda^2*R(r) = 0;

diff(diff(R(r), r), r)+(diff(R(r), r))/r+(-r^2+1)*lambda^2*R(r) = 0

(1)

``

dsolve(eq);

R(r) = _C1*exp(-(1/2)*lambda*r^2)*KummerM(1/2-(1/4)*lambda, 1, lambda*r^2)+_C2*exp(-(1/2)*lambda*r^2)*KummerU(1/2-(1/4)*lambda, 1, lambda*r^2)

(2)

``

dsolve({eq, (D(R))(0) = 0}, {R(r)})

R(r) = _C1*exp(-(1/2)*lambda*r^2)*KummerM(1/2-(1/4)*lambda, 1, lambda*r^2)

(3)

``````

``

``

``

R := proc (r) options operator, arrow; C1*exp(-(1/2)*lambda*r^2)*KummerM(1/2-(1/4)*lambda, 1, lambda*r^2)+_C2*exp(-(1/2)*lambda*r^2)*KummerU(1/2-(1/4)*lambda, 1, lambda*r^2) end proc

proc (r) options operator, arrow; C1*exp(-(1/2)*lambda*r^2)*KummerM(1/2-(1/4)*lambda, 1, lambda*r^2)+_C2*exp(-(1/2)*lambda*r^2)*KummerU(1/2-(1/4)*lambda, 1, lambda*r^2) end proc

(4)

``

``

``

D(R)

proc (r) options operator, arrow; -C1*lambda*r*exp(-(1/2)*lambda*r^2)*KummerM(1/2-(1/4)*lambda, 1, lambda*r^2)+2*C1*exp(-(1/2)*lambda*r^2)*((lambda*r^2-1/2-(1/4)*lambda)*KummerM(1/2-(1/4)*lambda, 1, lambda*r^2)+(1/2+(1/4)*lambda)*KummerM(-1/2-(1/4)*lambda, 1, lambda*r^2))/r-_C2*lambda*r*exp(-(1/2)*lambda*r^2)*KummerU(1/2-(1/4)*lambda, 1, lambda*r^2)+2*_C2*exp(-(1/2)*lambda*r^2)*((lambda*r^2-1/2-(1/4)*lambda)*KummerU(1/2-(1/4)*lambda, 1, lambda*r^2)-KummerU(-1/2-(1/4)*lambda, 1, lambda*r^2))/r end proc

(5)

``

``


Download Kummer.mwKummer.mw

                         

         
               

Hi all, 

Is it possible, and how, to disable the automatic completion in the "Advanced Search / keyword" field ?

Underlying this question is my looking for informations about cmaple (beyond what the help page displays : if I can't find any I will ask some specific ones later). But every time I type "cmaple" in the keyword textfield, it is replaced by "campée" (which is a french word ... I guess english people will obtain something different)

I would like the C-Text style in 14pt Times Roman while the C-2D-Math style is 12pt.

My use case is that I am typing in a single execution block.

I use Format >> Styles and select the style for C-Text and set it to 14pt Times. I click OK to close the dialog. Next I repeat this for the C-2D-Math style but this time set the font size to 12pt and, for testing, the colour to blue. The effect is to give me 14pt Times for both styles, though the C-text is black and the 2-D-Math is blue.

Can the effect I want be achieved, or is this a bug/feature?

This is Maple 2016.1 on Windows 10 64bit

 Thanks for any help

Hi everyone.

I'm going to solve a problem with HPM in Maple. I wrote some initial codes but now I'm confused becouse of P^0 coefficients in A1 and B1. I mean I can't reach to f0 and g0.

I upload that file. these are codes that i typed. could you please help me how can I reach to them(f0 & g0)?

http://www.filehosting.org/file/details/573095/Maple%20Project+.mw

Hi all,

Using the Physics package, I have defined a density operator, shown in the image below:

Definition of Density Operator

(I did assume(s ≠i), assume(v≠h).

I then operate on it with the Bracket as shown in the next image:

Bracket on Density Operator

 

I think this should evaluate to (|Y,s,h><Y,s,h|)/2; or at least that's the result I want. However, Maple evaluates this to zero.

Is there a where to convince Maple to evaluate this to what I want/expect?

Thanks in advance,

Kevin

why the current luca_amplificatore_retroazione.msimand voltage is egual to zero?

I don't know the use to me of having PDF exports having animations requiring huge emails since I don't own website. Yet, I've been fooling with Apple textbook maker app that has movie imort to PDFs. Someday, I'll use google drive links...

So, action item, maybe Maple would like to have a worksheet drop in to this apple textbook app Like movies. I hope it's easy from Apple taunting html5.

Hi,

 

I am trying to solve a simple system of the form AX=0, where A is a N*N matrix, X is an N*1 vector (and the right-hand side of the equation is an N*1 vector of zeros, I apologize for the inexact notation). The difficulty comes from the fact that the values of A are parameterized by 2*N parameters (that I will write as the 2*N vector P), and I would like to get a solution in the form X=f(P).

 

One solution is to try to use LinearAlgebra[LinearSolve], but it only returns the trivial solution X=0, which I am not interested in.

Another solution is to compute analytically the Moore-Penrose pseudoinverse Ag of A, as the general solution is of the form

(I - Ag A)f ;

where f is a vector of free parameters. However, even for a small matrix size (N=4), Maple is still computing after 3 hours on my (fairly powerful) machine, and it is taking more and more memory over time. As the results are polynomial/rational equations in the parameters P, I was actually expecting Maple to be more powerful than other softwares, but for this particular problem, Matlab's symbolic toolbox (muPAD) gives quick solutions until N=6. I need, in the end, to solve additional polynomial/rational equations that are derived from the solutions X=f(P), where Matlab fails. This is why I would really like to be able to solve the above-mentioned problem AX=0 with Maple in order to try to solve the subsequent step of the problem (polynomial system) with Maple.

 

Any suggestions on how to do this would be highly appreciated! Thank you very much for your time and help.

 

Laureline

I would prefer that all the polynomials generated in my workbook by MAPLE were in expanded form.  For instance, it the elements of a matrix are polynomials, I want to see the expanded form for all of them.  What do I type into a workbook to make this happen.  (I am a new user of MAPLE.) 

When I print 2 matrix it always try to multiply them. How to force just to show?

Hi, i am trying to solve my PDEs with HPM method ,but i get strange errors.

first one is :Error, (in trig/reduce/reduce) Maple was unable to allocate enough memory to complete this computation.  Please see ?alloc,

but when i run my last function again,the error chages,let me show you.


restart;
lambda:=0.5;K[r]:=0.5;Sc:=0.5;Nb:=0.1;Nt:=0.1;Pr:=10;
                              0.5
                              0.5
                              0.5
                              0.1
                              0.1
                               10
> EQUATIONS;


equ1:=diff(f(eta),eta$4)-R*(diff(f(eta),eta)*diff(f(eta),eta$2)-f(eta)*diff(f(eta),eta$2))-2*K[r]*diff(g(eta),eta)=0;

equ2:=diff(g(eta),eta$2)-R*(diff(f(eta),eta)*g(eta)-f(eta)*diff(g(eta),eta))+2*K[r]*diff(f(eta),eta)=0;

equ3:=diff(theta(eta),eta$2)+Pr*R*f(eta)*diff(theta(eta),eta)+Nb*diff(phi(eta),eta)*diff(theta(eta),eta)+Nt*diff(theta(eta),eta)^2=0;

equ4:=diff(phi(eta),eta$2)+R*Sc*f(eta)*diff(phi(eta),eta)+diff(theta(eta),eta$2)*(Nt/Nb)=0;
/  d   /  d   /  d   /  d         \\\\     //  d         \ /  d  
|----- |----- |----- |----- f(eta)|||| - R ||----- f(eta)| |-----
\ deta \ deta \ deta \ deta       ////     \\ deta       / \ deta

   /  d         \\          /  d   /  d         \\\
   |----- f(eta)|| - f(eta) |----- |----- f(eta)|||
   \ deta       //          \ deta \ deta       ///

         /  d         \    
   - 1.0 |----- g(eta)| = 0
         \ deta       /    
     /  d   /  d         \\
     |----- |----- g(eta)||
     \ deta \ deta       //

            //  d         \                 /  d         \\
        - R ||----- f(eta)| g(eta) - f(eta) |----- g(eta)||
            \\ deta       /                 \ deta       //

              /  d         \    
        + 1.0 |----- f(eta)| = 0
              \ deta       /    
  /  d   /  d             \\               /  d             \
  |----- |----- theta(eta)|| + 10 R f(eta) |----- theta(eta)|
  \ deta \ deta           //               \ deta           /

           /  d           \ /  d             \
     + 0.1 |----- phi(eta)| |----- theta(eta)|
           \ deta         / \ deta           /

                             2    
           /  d             \     
     + 0.1 |----- theta(eta)|  = 0
           \ deta           /     
    /  d   /  d           \\                /  d           \
    |----- |----- phi(eta)|| + 0.5 R f(eta) |----- phi(eta)|
    \ deta \ deta         //                \ deta         /

                     /  d   /  d             \\    
       + 1.000000000 |----- |----- theta(eta)|| = 0
                     \ deta \ deta           //    
> BOUNDARY*CONDITIONS;


ics:=
f(0)=0,D(f)(0)=1,g(0)=0,theta(0)=1,phi(0)=1;
f(1)=lambda,D(f)(1)=0,g(1)=0,theta(1)=0,phi(1)=0;
   f(0) = 0, D(f)(0) = 1, g(0) = 0, theta(0) = 1, phi(0) = 1
  f(1) = 0.5, D(f)(1) = 0, g(1) = 0, theta(1) = 0, phi(1) = 0
> HPMs;


hpm1:=(1-p)*(diff(f(eta),eta$4)-2*K[r]*diff(g(eta),eta))+p*(diff(f(eta),eta$4)-R*(diff(f(eta),eta)*diff(f(eta),eta$2)-f(eta)*diff(f(eta),eta$2))-2*K[r]*diff(g(eta),eta))=0;

hpm2:=(1-p)*(diff(g(eta),eta$2)+2*K[r]*diff(f(eta),eta))+p*(diff(g(eta),eta$2)-R*(diff(f(eta),eta)*g(eta)-f(eta)*diff(g(eta),eta))+2*K[r]*diff(f(eta),eta))=0;

hpm3:=(1-p)*(diff(theta(eta),eta$2))+p*(diff(theta(eta),eta$2)+Pr*R*f(eta)*diff(theta(eta),eta)+Nb*diff(phi(eta),eta)*diff(theta(eta),eta)+Nt*diff(theta(eta),eta)^2)=0;

hpm4:=(1-p)*(diff(phi(eta),eta$2)+diff(theta(eta),eta$2)*(Nt/Nb))+p*(diff(phi(eta),eta$2)+R*Sc*f(eta)*diff(phi(eta),eta)+diff(theta(eta),eta$2)*(Nt/Nb))=0;

        //  d   /  d   /  d   /  d         \\\\
(1 - p) ||----- |----- |----- |----- f(eta)||||
        \\ deta \ deta \ deta \ deta       ////

         /  d         \\     //  d   /  d   /  d   /  d         \
   - 1.0 |----- g(eta)|| + p ||----- |----- |----- |----- f(eta)|
         \ deta       //     \\ deta \ deta \ deta \ deta       /

  \\\     //  d         \ /  d   /  d         \\
  ||| - R ||----- f(eta)| |----- |----- f(eta)||
  ///     \\ deta       / \ deta \ deta       //

            /  d   /  d         \\\       /  d         \\    
   - f(eta) |----- |----- f(eta)||| - 1.0 |----- g(eta)|| = 0
            \ deta \ deta       ///       \ deta       //    
        //  d   /  d         \\       /  d         \\     //  d  
(1 - p) ||----- |----- g(eta)|| + 1.0 |----- f(eta)|| + p ||-----
        \\ deta \ deta       //       \ deta       //     \\ deta

   /  d         \\
   |----- g(eta)||
   \ deta       //

       //  d         \                 /  d         \\
   - R ||----- f(eta)| g(eta) - f(eta) |----- g(eta)||
       \\ deta       /                 \ deta       //

         /  d         \\    
   + 1.0 |----- f(eta)|| = 0
         \ deta       //    
                                       /                         
        /  d   /  d             \\     |/  d   /  d             \
(1 - p) |----- |----- theta(eta)|| + p ||----- |----- theta(eta)|
        \ deta \ deta           //     \\ deta \ deta           /

  \               /  d             \
  | + 10 R f(eta) |----- theta(eta)|
  /               \ deta           /

         /  d           \ /  d             \
   + 0.1 |----- phi(eta)| |----- theta(eta)|
         \ deta         / \ deta           /

                           2\    
         /  d             \ |    
   + 0.1 |----- theta(eta)| | = 0
         \ deta           / /    
        //  d   /  d           \\
(1 - p) ||----- |----- phi(eta)||
        \\ deta \ deta         //

                 /  d   /  d             \\\     //  d   /  d   
   + 1.000000000 |----- |----- theta(eta)||| + p ||----- |-----
                 \ deta \ deta           ///     \\ deta \ deta

          \\                /  d           \
  phi(eta)|| + 0.5 R f(eta) |----- phi(eta)|
          //                \ deta         /

                 /  d   /  d             \\\    
   + 1.000000000 |----- |----- theta(eta)||| = 0
                 \ deta \ deta           ///    
f(eta)=sum(f[i](eta)*p^i,i=0..1);
                f(eta) = f[0](eta) + f[1](eta) p
g(eta)=sum(g[i](eta)*p^i,i=0..1);
                g(eta) = g[0](eta) + g[1](eta) p
theta(eta)=sum(theta[i](eta)*p^i,i=0..1);
          theta(eta) = theta[0](eta) + theta[1](eta) p
phi(eta)=sum(phi[i](eta)*p^i,i=0..1);
             phi(eta) = phi[0](eta) + phi[1](eta) p
> FORequ1;


A:=collect(expand(subs(f(eta)=f[0](eta)+f[1](eta)*p,g(eta)=g[0](eta)+g[1](eta)*p,hpm1)),p);
/      /  d            \ /  d   /  d            \\
|-1. R |----- f[1](eta)| |----- |----- f[1](eta)||
\      \ deta          / \ deta \ deta          //

                 /  d   /  d            \\\  3   /
   + R f[1](eta) |----- |----- f[1](eta)||| p  + |
                 \ deta \ deta          ///      \
      /  d            \ /  d   /  d            \\
-1. R |----- f[0](eta)| |----- |----- f[1](eta)||
      \ deta          / \ deta \ deta          //

          /  d            \ /  d   /  d            \\
   - 1. R |----- f[1](eta)| |----- |----- f[0](eta)||
          \ deta          / \ deta \ deta          //

                 /  d   /  d            \\
   + R f[0](eta) |----- |----- f[1](eta)||
                 \ deta \ deta          //

                 /  d   /  d            \\\  2   //  d   /  d   /
   + R f[1](eta) |----- |----- f[0](eta)||| p  + ||----- |----- |
                 \ deta \ deta          ///      \\ deta \ deta \

    d   /  d            \\\\       /  d            \
  ----- |----- f[1](eta)|||| - 1.0 |----- g[1](eta)|
   deta \ deta          ////       \ deta          /

          /  d            \ /  d   /  d            \\
   - 1. R |----- f[0](eta)| |----- |----- f[0](eta)||
          \ deta          / \ deta \ deta          //

                 /  d   /  d            \\\  
   + R f[0](eta) |----- |----- f[0](eta)||| p
                 \ deta \ deta          ///  

     /  d   /  d   /  d   /  d            \\\\
   + |----- |----- |----- |----- f[0](eta)||||
     \ deta \ deta \ deta \ deta          ////

         /  d            \    
   - 1.0 |----- g[0](eta)| = 0
         \ deta          /    
A1:=diff(f[0](eta),eta$4)-2*K[r]*(diff(g[0](eta),eta))=0;
A2:=diff(f[1](eta),eta$4)-2*K[r]*(diff(g[1](eta),eta))-R*(diff(f[0](eta),eta))*(diff(f[0](eta),eta$2))+R*f[0](eta)*(diff(f[0](eta),eta$2))=0;
/  d   /  d   /  d   /  d            \\\\       /  d            \   
|----- |----- |----- |----- f[0](eta)|||| - 1.0 |----- g[0](eta)| =
\ deta \ deta \ deta \ deta          ////       \ deta          /   

  0
/  d   /  d   /  d   /  d            \\\\       /  d            \
|----- |----- |----- |----- f[1](eta)|||| - 1.0 |----- g[1](eta)|
\ deta \ deta \ deta \ deta          ////       \ deta          /

       /  d            \ /  d   /  d            \\
   - R |----- f[0](eta)| |----- |----- f[0](eta)||
       \ deta          / \ deta \ deta          //

                 /  d   /  d            \\    
   + R f[0](eta) |----- |----- f[0](eta)|| = 0
                 \ deta \ deta          //    
icsA1:=f[0](0)=0,D(f[0])(0)=1,g[0](0)=0,f[0](1)=lambda,D(f[0])(1)=0,g[0](1)=0;
icsA2:=f[1](0)=0,D(f[1])(0)=0,g[1](0)=0,f[1](1)=0,D(f[1])(1)=0,g[1](1)=0;
   f[0](0) = 0, D(f[0])(0) = 1, g[0](0) = 0, f[0](1) = 0.5,

     D(f[0])(1) = 0, g[0](1) = 0
    f[1](0) = 0, D(f[1])(0) = 0, g[1](0) = 0, f[1](1) = 0,

      D(f[1])(1) = 0, g[1](1) = 0
>
FORequ2;


B:=collect(expand(subs(f(eta)=f[0](eta)+f[1](eta)*p,g(eta)=g[0](eta)+g[1](eta)*p,hpm2)),p);
/      /  d            \          
|-1. R |----- f[1](eta)| g[1](eta)
\      \ deta          /          

                 /  d            \\  3   /
   + R f[1](eta) |----- g[1](eta)|| p  + |
                 \ deta          //      \
      /  d            \          
-1. R |----- f[0](eta)| g[1](eta)
      \ deta          /          

          /  d            \          
   - 1. R |----- f[1](eta)| g[0](eta)
          \ deta          /          

                 /  d            \
   + R f[0](eta) |----- g[1](eta)|
                 \ deta          /

                 /  d            \\  2   //  d   /  d            
   + R f[1](eta) |----- g[0](eta)|| p  + ||----- |----- g[1](eta)
                 \ deta          //      \\ deta \ deta          

  \\       /  d            \        /  d            \          
  || + 1.0 |----- f[1](eta)| - 1. R |----- f[0](eta)| g[0](eta)
  //       \ deta          /        \ deta          /          

                 /  d            \\     /  d   /  d            \\
   + R f[0](eta) |----- g[0](eta)|| p + |----- |----- g[0](eta)||
                 \ deta          //     \ deta \ deta          //

         /  d            \    
   + 1.0 |----- f[0](eta)| = 0
         \ deta          /    
B1:=diff(g[0](eta),eta$2)+2*K[r]*(diff(f[0](eta),eta))=0;
B2:=diff(g[1](eta),eta$2)+2*K[r]*(diff(f[1](eta),eta))-R*(diff(f[0](eta),eta))*g[0](eta)+R*f[0](eta)*(diff(g[0](eta),eta))=0;
     /  d   /  d            \\       /  d            \    
     |----- |----- g[0](eta)|| + 1.0 |----- f[0](eta)| = 0
     \ deta \ deta          //       \ deta          /    
       /  d   /  d            \\       /  d            \
       |----- |----- g[1](eta)|| + 1.0 |----- f[1](eta)|
       \ deta \ deta          //       \ deta          /

              /  d            \          
          - R |----- f[0](eta)| g[0](eta)
              \ deta          /          

                        /  d            \    
          + R f[0](eta) |----- g[0](eta)| = 0
                        \ deta          /    
icsB1:=f[0](0)=0,D(f[0])(0)=1,g[0](0)=0,f[0](1)=lambda,D(f[0])(1)=0,g[0](1)=0;
icsB2:=f[1](0)=0,D(f[1])(0)=0,g[1](0)=0,f[1](1)=0,D(f[1])(1)=0,g[1](1)=0;
   f[0](0) = 0, D(f[0])(0) = 1, g[0](0) = 0, f[0](1) = 0.5,

     D(f[0])(1) = 0, g[0](1) = 0
    f[1](0) = 0, D(f[1])(0) = 0, g[1](0) = 0, f[1](1) = 0,

      D(f[1])(1) = 0, g[1](1) = 0
> FORequ3;


C:=collect(expand(subs(theta(eta)=theta[0](eta)+theta[1](eta)*p,phi(eta)=phi[0](eta)+phi[1](eta)*p,f(eta)=f[0](eta)+f[1](eta)*p,hpm3)),p);
 /                                     
 |                /  d                \
 |10. R f[1](eta) |----- theta[1](eta)|
 \                \ deta              /

          /  d              \ /  d                \
    + 0.1 |----- phi[1](eta)| |----- theta[1](eta)|
          \ deta            / \ deta              /

                               2\                              
          /  d                \ |  3   /                /  d   
    + 0.1 |----- theta[1](eta)| | p  + |10. R f[0](eta) |-----
          \ deta              / /      \                \ deta

                \                   /  d                \
   theta[1](eta)| + 10. R f[1](eta) |----- theta[0](eta)|
                /                   \ deta              /

          /  d              \ /  d                \
    + 0.1 |----- phi[0](eta)| |----- theta[1](eta)|
          \ deta            / \ deta              /

          /  d              \ /  d                \
    + 0.1 |----- phi[1](eta)| |----- theta[0](eta)|
          \ deta            / \ deta              /

                                                            /
          /  d                \ /  d                \\  2   |/
    + 0.2 |----- theta[0](eta)| |----- theta[1](eta)|| p  + ||
          \ deta              / \ deta              //      \\

     d   /  d                \\
   ----- |----- theta[1](eta)||
    deta \ deta              //

                      /  d                \
    + 10. R f[0](eta) |----- theta[0](eta)|
                      \ deta              /

          /  d              \ /  d                \
    + 0.1 |----- phi[0](eta)| |----- theta[0](eta)|
          \ deta            / \ deta              /

                               2\  
          /  d                \ |  
    + 0.1 |----- theta[0](eta)| | p
          \ deta              / /  

      /  d   /  d                \\    
    + |----- |----- theta[0](eta)|| = 0
      \ deta \ deta              //    
C1:=diff(theta[0](eta),eta$2)=0;
C2:=diff(theta[1](eta), eta, eta)+Pr*R*f[0](eta)*(diff(theta[0](eta), eta))+Nb*(diff(phi[0](eta), eta))*(diff(theta[0](eta), eta))+Nt*(diff(theta[0](eta), eta))^2=0;
                  d   /  d                \    
                ----- |----- theta[0](eta)| = 0
                 deta \ deta              /    
       /  d   /  d                \\
       |----- |----- theta[1](eta)||
       \ deta \ deta              //

                           /  d                \
          + 10 R f[0](eta) |----- theta[0](eta)|
                           \ deta              /

                /  d              \ /  d                \
          + 0.1 |----- phi[0](eta)| |----- theta[0](eta)|
                \ deta            / \ deta              /

                                     2    
                /  d                \     
          + 0.1 |----- theta[0](eta)|  = 0
                \ deta              /     
icsC1:=theta[0](0)=1,theta[0](1)=0;
icsC2:=theta[1](0)=0,theta[1](1)=0,phi[0](0)=0,phi[0](1)=0;
                theta[0](0) = 1, theta[0](1) = 0
 theta[1](0) = 0, theta[1](1) = 0, phi[0](0) = 0, phi[0](1) = 0
> FORequ4;


E:=collect(expand(subs(theta(eta)=theta[0](eta)+theta[1](eta)*p,phi(eta)=phi[0](eta)+phi[1](eta)*p,f(eta)=f[0](eta)+f[1](eta)*p,hpm4)),p);
                 3 /  d              \   /                /  d   
0.5 R f[1](eta) p  |----- phi[1](eta)| + |0.5 R f[0](eta) |-----
                   \ deta            /   \                \ deta

             \                   /  d              \\  2   //
  phi[1](eta)| + 0.5 R f[1](eta) |----- phi[0](eta)|| p  + ||
             /                   \ deta            //      \\

    d   /  d              \\
  ----- |----- phi[1](eta)||
   deta \ deta            //

                 /  d   /  d                \\
   + 1.000000000 |----- |----- theta[1](eta)||
                 \ deta \ deta              //

                     /  d              \\  
   + 0.5 R f[0](eta) |----- phi[0](eta)|| p
                     \ deta            //  

     /  d   /  d              \\
   + |----- |----- phi[0](eta)||
     \ deta \ deta            //

                 /  d   /  d                \\    
   + 1.000000000 |----- |----- theta[0](eta)|| = 0
                 \ deta \ deta              //    
E1:=diff(phi[0](eta),eta$2)+Nt*(diff(theta[0](eta),eta$2))/Nb=0;
E2:=diff(phi[1](eta),eta$2)+Nt*(diff(theta[1](eta),eta$2))/Nb+R*Sc*f[0](eta)*(diff(phi[0](eta),eta))=0;
       /  d   /  d              \\
       |----- |----- phi[0](eta)||
       \ deta \ deta            //

                        /  d   /  d                \\    
          + 1.000000000 |----- |----- theta[0](eta)|| = 0
                        \ deta \ deta              //    
         /  d   /  d              \\
         |----- |----- phi[1](eta)||
         \ deta \ deta            //

                          /  d   /  d                \\
            + 1.000000000 |----- |----- theta[1](eta)||
                          \ deta \ deta              //

                              /  d              \    
            + 0.5 R f[0](eta) |----- phi[0](eta)| = 0
                              \ deta            /    
icsE1:=theta[0](0)=1,theta[0](1)=0,phi[0](0)=1,phi[0](1)=0;
icsE2:=theta[1](0)=0,theta[1](1)=0,phi[1](0)=0,phi[1](1)=0;
 theta[0](0) = 1, theta[0](1) = 0, phi[0](0) = 1, phi[0](1) = 0
 theta[1](0) = 0, theta[1](1) = 0, phi[1](0) = 0, phi[1](1) = 0
       
theta[0](eta) = -(152675527/100000000)*eta+1;
                                152675527        
              theta[0](eta) = - --------- eta + 1
                                100000000        
U:=f[1](eta)=0;
                         f[1](eta) = 0
Dsolve(A1,B1,icsA1,icsB1);
                  Dsolve(A1, B1, icsA1, icsB1)


sys:={ diff(g[0](eta), eta, eta)+1.0*(diff(f[0](eta), eta)) = 0, diff(f[0](eta), eta, eta, eta, eta)-1.0*(diff(g[0](eta), eta)) = 0};
    //  d   /  d   /  d   /  d            \\\\
   { |----- |----- |----- |----- f[0](eta)||||
    \\ deta \ deta \ deta \ deta          ////

            /  d            \      
      - 1.0 |----- g[0](eta)| = 0,
            \ deta          /      

     /  d   /  d            \\       /  d            \    \
     |----- |----- g[0](eta)|| + 1.0 |----- f[0](eta)| = 0 }
     \ deta \ deta          //       \ deta          /    /
IC_1:={ f[0](0) = 0, (D(f[0]))(0) = 1, g[0](0) = 0, f[0](1) = .5, (D(f[0]))(1) = 0, g[0](1) = 0,f[0](0) = 0, (D(f[0]))(0) = 1, g[0](0) = 0, f[0](1) = .5, (D(f[0]))(1) = 0, g[0](1) = 0};
    {f[0](0) = 0, f[0](1) = 0.5, g[0](0) = 0, g[0](1) = 0,

      D(f[0])(0) = 1, D(f[0])(1) = 0}
ans1 := combine(dsolve(sys union IC_1,{f[0](eta),g[0](eta)}),trig);
Error, (in dsolve) expecting an ODE or a set or list of ODEs. Received `union`(IC_1, sys)
>
 

using worksheet mode, is there a way to automatically color any comments after (#) with a different color than the default red?

I have been using Maple for years and did not need to significantly document or comment on my worksheets before because I only needed to share my worksheets with close collegues who have a lot of experience with Maple too. However, now I need to share my code with a general audience that might not be a Maple user. So I need to add enough comments after each line, and I have been manually changing the color of comments after the # to green to give the reader the indication that this is a comment and not part of the code, like this for example:

 

restart;

f:=(x,y)->sin(sqrt(x^2+y^2))/sqrt(x^2+y^2); # Define f as a function of the variables x and y

proc (x, y) options operator, arrow; sin(sqrt(x^2+y^2))/sqrt(x^2+y^2) end proc

(1)

df:=(x,y)->eval(diff(f(a,y),a),a=x); # Define df as the partial derivative of f with respect to x

proc (x, y) options operator, arrow; eval(diff(f(a, y), a), a = x) end proc

(2)

df(1,3); # Evaluate df at x=1, y=3

(1/10)*cos(10^(1/2))-(1/100)*sin(10^(1/2))*10^(1/2)

(3)

 

 

Download Worksheet-coloring-comments.mw



It would be great if Maple can automatically color comments like typical editors do. Is this possible? if not, does anyone have an advice for a nice easy way to add proper documentation to worksheets?

First 160 161 162 163 164 165 166 Last Page 162 of 334