MaplePrimes Questions

I'm presently checking the ability of inttrans:-laplace to give results one can find in the literature.
Unfortunately the inttrans:-laplace's  answers are sometimes more complex than those published in the literature and I'm not capable to simplify the output.

For instance

f := (t+1)/sqrt(t^2+2*t);
L := laplace((t+1)/sqrt(t^2+2*t), t, p);

expresses L in terms of WhittakerW and BesselK(0, p) functions as the answer simply is

exp(p)*BesselK(1, p)

Laplace.mw

How can I get this result with Maple?

TIA

By default, CodeGeneration generates temporary names during optimize of t####. For compatibility with other code, I would like to have flexibility in choosing the preamble to the temporary variable name ("t" is default). Is there a way to do this?

I don't see anything in the documentation, but it seems like something one should be able to do.

(My target language is Python - although I'm not really using Python, the syntax is compatible).

I came across what looks to me like an error in Maple 2023.  If it stands alone, Maple evaluates z^0/0! to 1, but inside the sum command it appears to evaluate the same expression to 0.

Download Weird_sum_behaviour.mw

I've tried some simple uses of solve in MapleFlow without success. For example

solve(f=ma,a)

does not return

f/m

Does solve work in MapleFlow? Is there a problem with this Maple syntax in MapleFlow?

Hi,

I am trying to combine two simple plots of spacecurve and surface but can't manage. Asking for help because I know it doable, it is too simple not to be...

So I need something like this:

trying tirh spacecurve and surface and in general it appears together but cannot align axes so both are wrongly rotataed. Is there any simple and elegant way (without Maple programming language, I am not using it yet) in Maple document with few commands?

Thanks in advance

Marcin

I have a PDE

eq1 := du/dx+dv/dy = 0; eq2 := du/dt+u*du/dx+v*du/dy-nu*d^2*u/dy^2 = 0

where u(x, y, t), v(x, y, t) and

eta(x, y, t):=y/((nu*t*cos(alpha)+(nu*x)/(U[w])*sin(alpha))^(1/(2)));

psi(x, y, t):=U[w]*(nu*t*cos(alpha)+(nu*x)/(U[w])*sin(alpha))^(1/(2))*f(eta(x,y,t));

u = diff(psi, y); v= -diff(psi, x).

How to substitiute u = diff(psi, y); v= -diff(psi, x) in eq1 and eq2, Also find the value of nu.

Does Maple handle .graphml files correctly?  When I tell Maple to export a weighted graph as Example.graphml and then import it, the edge weights come back lower than before. 

Hi,

How can I find the same result reported in the figure for dsolve the differential equation?

nima.mw

 

 

When I input
restart;
a := 2;
b := 3;
p := x^2 - a*x - b*x +a*b ;

I get p := x^2 - 5*x + 6
How can I get x^2 - 2 x - 3x + 6.
General question. I have (a,b) in a list [[2,3],[-3,7],[9,10]]. How to subtitute them to get the result
[[x^2 - 2x - 3x + 6, x^2 + 3x - 7x -21, x^2 - 9x - 10x + 90]? 

I am trying to learn Maple and Fourier transform by calculating the coefficients and the resuting summation as follows:

restart;

assume(n>0);

assume(N>0);

target_f := x -> piecewise(-Pi < x and x < 0, 0, 0 < x and x < Pi, x, Pi < x and x < 2*Pi, 0, 2*Pi < x and x < 3*Pi, x - 2*Pi)

a0 := simplify(int(target_f(x), x = -Pi .. Pi)/(2*Pi))

a_n := int(target_f(x)*cos(n . x), x = -Pi .. Pi)/Pi

b_n := int((target_f(x)) . (sin(n*x)), x = -Pi .. Pi)/Pi

fourier_f := N -> a0 + sum(a_n*cos(n*x) + b_n*sin(n . x), n = 1 .. N)

I am making fourier_f as a function of N becasue I want to see the effect of increasing partial sums. The resulting output of the summation "fourier_f" has a lot of terms. The output looks like this:

               /        /  N      
               |        |-----    
               |        | \       
1         1    |   2    |  )   /  
- Pi + ------- |4 N  Pi | /    |- 
4            2 |        |----- |  
       4 Pi N  \        \n = 1 \  

                                        \                     
                                        |                     
                                        |                     
  sin(n x) (cos(n Pi) n Pi - sin(n Pi))\|   /   2             
  -------------------------------------|| + \I N  Pi LerchPhi(
                   2                   ||                     
                  n  Pi                //                     

                         2                                    
  -exp(-I x), 1, N) - 2 N  LerchPhi(-exp(-I x), 2, N) - I N Pi

      \                  
   + 2/ exp(I N (Pi - x))

   - I N Pi (LerchPhi(-exp(I x), 1, N) N - 1) exp(I N (-Pi + x))

        2                                                 
   - I N  Pi LerchPhi(-exp(-I x), 1, N) exp(-I N (Pi + x))

                                 /   2                            
   + I Pi N exp(-I N (Pi + x)) + \I N  Pi LerchPhi(-exp(I x), 1, N

         2                                       \            
  ) - 2 N  LerchPhi(-exp(I x), 2, N) - I N Pi + 2/ exp(I N (Pi

                          2                          
   + x)) + 2 exp(-I x N) N  LerchPhi(exp(-I x), 2, N)

                   2                         
   + 2 exp(I x N) N  LerchPhi(exp(I x), 2, N)

        2                            2                     
   - 2 N  polylog(2, exp(-I x)) - 2 N  polylog(2, exp(I x))

        2                             2                      
   + 2 N  polylog(2, -exp(-I x)) + 2 N  polylog(2, -exp(I x))

                                 \
                                 |
                                 |
                                 |
   - 2 exp(-I x N) - 2 exp(I x N)|
                                 |
                                 /

The target function is not that complicated. I am using the target function shown in this YouTube video: https://www.youtube.com/watch?v=praNtRezlkw&list=PLPBSZvbAshbxULtiBcygm1qh7BtsDv3DW&index=12

It gave me similar output when the target function was x2.  I am not sure what's going on because for a simple square wave, I was able to make this work correctly.

I am deliberately not using existing packages because I want to learn Maple syntax.

Can someone please tell me what's my mistake ?

Wolfram's marketing literature states that a compiled function may generate the dates for the years 1 through 5.7 million in a couple of seconds rather than in minutes (comparing to the "uncompiled implementation").
The given function in this link can be translated into Maple language as follows: 

(*
  Note that this is only a mathematical program that outputs some data,
   hence 'Easter(-2, 1)' will never return real Gregorian Easter dates!
*)
Easter:=proc(BEGIN::integer[4],END::integer[4],$)::Array(BEGIN..END,[integer[1..12],integer[1..31]]);# the parent function
	description "https://www.wolfram.com/language/12/code-compilation/compute-the-date-of-easter.html";
	local computus::procedure[[integer[1 .. 12], integer[1 .. 31]]](integer):=proc(Year::integer,` $`)::[integer[1..12],integer[1..31]];# the child function
		options threadsafe;
		local a::nonnegint,b::integer,c::nonnegint,d::integer,e::nonnegint,f::integer,g::nonnegint,h::nonnegint,i::nonnegint,j::nonnegint,k::nonnegint,Month::integer[1..12],Day::integer[1..31];
		(* For compatibility, when `Year` is nonpositive, the command `iquo` must be replaced with slower `floor`. *)
		if Year<=0 then
			a,b,c:=Year mod 19,floor(Year/100),Year mod 100;
			d,e,f:=floor(b/4),b mod 4,floor((8*b+13)/25);
			g,h,i:=19*a+b-d-f+15 mod 30,floor(c/4),c mod 4;
			j:=floor((a+11*g)/319);k:=2*e+2*h-i-g+j+32 mod 7;
			Month:=floor((g-j+k+90)/25);Day:=g-j+k+Month+19 mod 32
		else
			a,b,c:=irem(Year,19),iquo(Year,100),irem(Year,100):
			d,e,f:=iquo(b,4),irem(b,4),iquo(8*b+13,25);
			g,h,i:=irem(19*a+b-d-f+15,30),iquo(c,4),irem(c,4);
			j:=iquo(a+11*g,319);k:=irem(2*e+2*h-i-g+j+32,7);
			Month:=iquo(g-j+k+90,25);Day:=irem(g-j+k+Month+19,32)
		fi;
		[Month,Day]
	end;
	Array(BEGIN..END,computus)
end:

However, as "no nested procedures can be translated" to optimized native machine code (cf. ), executing Easter(1, 5700000) has to take at least two minutes

Is there some workaround that can provide improved performance for such a numerical procedure that contains a nested procedure? In other words, is it possible to produce the `result` (without modifying the algorithm) in two seconds in modern Maple as that Wolfram marketing literature claims?

I think this is a simple thing but I cannot find the solution. I have lots of complicated computations in Maple 2015 (with different functions of different packages), but I need the final result to be real numbers/functions. Is there a way to prevent maple following along with computations if it detects a potential complex number? For example, if in some internal step is taking sqrt(x) it should stop and tell something like: "you must assume x is positive".

Dear Maple experts

I am using the following two implicitplot commands successfully for variables diffr1 and diffr2:

implicitplot(diffr1, 0. .. 1, 0. .. 1.0, filledregions = true, coloring = [cyan, yellow]);

implicitplot(diffr2, 0. .. 1, 0. .. 1.0, filledregions = true, coloring = [cyan, yellow]);

Now I want to have a plot that mixes them. For example, if diffr1>0 and diffr2>0 I get a color. if diffr1>0 and diffr2<0 I get another color, etc. Is there any way to do that? 

Could someone provide me with the references used when implementing the Statistics:-PredictiveLeastSquares function?

TIA

First 178 179 180 181 182 183 184 Last Page 180 of 2427