Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Boundary condition of my problem is   f(0) =1  and  d(f)(1) = -(k[f]/k[nf])*Bi*f(1).

But i am getting error when solve this.How to clear this .

my attached file is,

HNF_1.mw

Dear Users!

I hope everyone is fine here. In the attached file I have solved a partial differential equation using the finite difference method for different mesh in spatial directions (i.e., for different Mx). I want to compute the time and memory to compute the solution against each Mx and want to plot it. Kindly help me how to compute the time and memory for each value of Mx.

TIME.mw

I shall be waiting. Thanks in advance. 

Hello

I would like to compare the digits of two natural numbers p and q first. Then I would like to omit in p and q the digits which they have in common.

Example: p=2345, q=1536

the common digits are 3 and 5. omitted them in both numbers, it will result p'=24 and q'=16.

Thanks for your help!

Here is an example where IntegrationTools:-Combine does not seem capable to combine two integrals whose lower bounds are -infinity (same situation holds where upper bounds equal to +infinity).

Is there a way to Combine(J1) without using the J3 workaround?
Is there any mathematical reason why Combine(J1) does not work or it is due to the way Maple handles infinity?

Thanks in advance.

IntegrationTools_Combine.mw

IsFrobeniusGroup(SmallGroup(20, 3)) will get true, but IsFrobeniusPermGroup(SmallGroup(20, 3)) will get false. What happen? As the documentation, it will get same result:

The two definitions are equivalent in the following sense.  If G is a Frobenius permutation group, then G is Frobenius as an abstract group

I have the following double integral:

In the above integral, r and sigma are the random variables: r is distributed normally with a mean and standard deviation equal to sigma, which is a random variable by itself (k near sigma in integral is a known parameter). Sigma is distributed lognormally, with a known mean and standard deviation. The probability density function of the sigma is defined by fs(sigma) in the above integral. How is it possible to solve this integral in Maple?

Thanks in advance 

I want a maple code to solve the caputo fabrizio differential equations using Runge Kutta method with implicit functions and impulsive conditions in maple. Is there any code structure for that. 

restart;
with(Student[NumericalAnalysis]);
with(plots);
with(DEtools);
f := proc(u, r) local res; res := 1/25*r^2 + (sin(u(r)) + sin(diff(u(r), [r $ 1/5])))/(r^2 + 47); return res; end proc;


RK4 := proc(f, u0, r0, h, n) local u, r, i, k1, k2, k3, k4; u := Vector(n + 1); r := Vector(n + 1); u[1] := u0; r[1] := r0; for i to n do k1 := f(u[i], t[i]); k2 := f(u[i] + 1/2*h*k1, r[i] + 1/2*h); k3 := f(u[i] + 1/2*h*k2, r[i] + 1/2*h); k4 := f(u[i] + h*k3, r[i] + h); u[i + 1] := u[i] + 1/6*h*(k1 + 2*k2 + 2*k3 + k4); r[i + 1] := r[i] + h; end do; return [u, r]; end proc;
RK4 := proc (f, u0, r0, h, n) local u, r, i, k1, k2, k3, k4; u 

   := Vector(n+1); r := Vector(n+1); u[1] := u0; r[1] := r0; 

   for i to n do k1 := f(u[i], t[i]); k2 := f(u[i]+(1/2)*h*k1, 

   r[i]+(1/2)*h); k3 := f(u[i]+(1/2)*h*k2, r[i]+(1/2)*h); k4 := 

   f(u[i]+h*k3, r[i]+h); u[i+1] := u[i]+(1/6)*h*(k1+2*k2+2*k3+k4\

  ); r[i+1] := r[i]+h end do; return [u, r] end proc


u0 := cos(abs(0.9))/15;
                      u0 := 0.04144066455

r0 := 0;
                            r0 := 0

h := 0.1;
                            h := 0.1

n := 100;
                            n := 100

solution := RK4(f, u0, r0, h, n)

u := solution[1];
r := solution[2];
plot(u, r, style = line, color = blue, labels = ["Time (r)", "Solution (u)"]);
 is this correct to solve the implicit fractional differential equations using 4th order Runge-Kutta Method. will fsolve command  solve the fractional differential equations ?

Hello
i am using maple 2023 and the physics package and have the following question:
I want to define a gauge-  plus coordinate covariant derivative i.e.
assuming i,j,k are SO(3) indices and greek indices describe 4-dim space-time (not necessary flat)
i need the following derivative:

D_sigma F_i _rho _lambda = nabla_sigma F_i _rho _lambda + epsilon_i ^j ^k  A_j_sigma  F_k~rho~lambda
with _ meaning lower indices and ^ upper indices and nabla the convenient coordinate covariant derivative of general relativity.
F is a tensor objekt with 2 space time indices and 1 so(3) indices (e.g. Yang Mills field strength) and A is the so(3)gauge potential
How can i define this Differentialoperator with the physics package.
I.e. i want to work with SO(3) Yang-Mills Fields in curved space time and need this generalized Differentialoperator
thanks for helping. I hope its clear from this ascii text in the screen
regards Michael

I want to find the formula for seq: 

För example 

{0,4,16,36,64,100,..}

{0,3,6,11,18,27.38,...}

How do i revers i backword fo get arithmetic sequence formula. I now the answare but want to learn how it's done in maple. I tried the app but i was not able to solve it. I have read the help and it looks like you have to use rsolve. Does anyboy has a sample to do not is trail and error. 

restart;

Here we have a pretty well-behaved trig function:

y := t -> 144*cos(t)^6 - 216*cos(t)^4 + 32*cos(t)^3 + 81*cos(t)^2 - 24*cos(t) + 17;

proc (t) options operator, arrow; 144*cos(t)^6-216*cos(t)^4+32*cos(t)^3+81*cos(t)^2-24*cos(t)+17 end proc

plot(y(t), t=0..2*Pi, view=0..35);

Maple 2023 plots y^(3/2) with a strange artifact at t = Pi:

plot(y(t)^(3/2), t=0..2*Pi, view=0..200);

Any reason for that?  Maple 2021 and earlier used to produce the correct plot:

  

Download bug-in-plot.mw

Hi.

why in eq1 some parameters such as beta 1, Q110,... are not placed (They defined before eq1 !!!!)

Thanks

TRASH.mw

When I use IdentifySmallGroup(DihedralGroup(4)), I will get result 8,3. Then I know DihedralGroup(4) is SmallGroup(8, 3) actually. But I will get different result when I use it in IsTransitive:

IsTransitive(DihedralGroup(4), [1, 2, 3, 4])

true

IsTransitive(SmallGroup(8, 3), [1, 2, 3, 4])

false

How to rectify this error.

NF-1.mw

How should optional input parameters be handled for procedures. The example has three optional inputs 

vars:=[x,y]   ,  clr:="b"   and prnt:="y"  . if one wants to change prnt to"n", vars and clr values must be entered.

{vars:=[x,y]  } , { clr:="b" }  and{ prnt:="y"}  this is a good method because one just enteres prnt="n".  But have to remember the input parameter name prnt.

I have a 3rd option, but it is to complicated and probably unreliable to use in practice.  and with more than 3 optional inputs too difficult to code.

I am wondering  are the other approaches and what is the prefered methodology. I have about 30+ procedures to apply this to in a package.

Edit:-  I can change the prnt to boolean true, false instead of "y" , "n".  That would make the all the optional inputs different types.

In Test1 its should be vars::list:=[x,y] not vars::{list , `string`}:=[x,y]

restart

Geomclr := "b"

"b"

(1)

NULL

NULL

NULL

Test1 := proc (A, B, vars::{list, string} := [x, y], clr::string := Geomclr, prnt::string := "y") if vars::string then clr := vars; vars := [x, y] end if; if clr = "y" or clr = "n" then prnt := clr; clr := Geomclr end if; print(clr); if prnt = "y" then print("good") end if; A*vars[1]+B*vars[2] end proc

NULL

Test1(A, B)

A*x+B*y

(2)

Test1(A, B, [r, s], "n")

Error, (in Test1) invalid left hand side in assignment

 

Test1(A, B, "g")

Error, (in Test1) invalid left hand side in assignment

 

Test1(A, B, "n")

Error, (in Test1) invalid left hand side in assignment

 

Test1(A, B, [x, y], "b", "n")

A*x+B*y

(3)

 

 

NULL

``

NULL

 

NULL

Test2 := proc (A, B, { vars::{list} := [x, y], clr::string := Geomclr, prnt::string := "y" }) print(clr); if prnt = "y" then print("good") end if; A*vars[1]+A*vars[2] end proc

NULL

NULL

Test2(A, B)

A*x+A*y

(4)

Test2(A, B, clr = "r")

A*x+A*y

(5)

Test2(A, B, prnt = "n")

A*x+A*y

(6)

Test2(A, B, prnt = "n")

A*x+A*y

(7)

Test2(A, B, prnt = "n", clr = "green", l = [r, s])

A*x+A*y

(8)

``

 

# 3 This is possible but is a very complicated method of handling the optional inputs and difficult the handle altered sequence on inputs.

NULL

Test3 := proc (A, B, vars::{list, string} := [x, y], clr::string := Geomclr, prnt::string := "y") local varsl, clrl, prntl; global Geomclr; varsl := vars; clrl := clr; prntl := prnt; if vars::string then varsl := [x, y]; if vars = "y" or vars = "n" then prntl := vars; clrl := Geomclr elif vars = "r" or vars = "g" or vars = "b" then clrl := vars end if elif vars::list and clr = "y" or clr = "n" then prntl := clr; clrl := Geomclr end if; if clr = "y" or clr = "n" and vars::string then prntl := clr; clrl := vars end if; print("Colour print out ", clrl); if prntl = "y" then print("This is a test Message") end if; A*varsl[1]+B*varsl[2] end proc

NULL

Test3(A, B)

A*x+B*y

(9)

Test3(A, B, [r, s])

A*r+B*s

(10)

Test3(A, B, [r, s], "n")

A*r+B*s

(11)

Test3(A, B, "n")

A*x+B*y

(12)

Test3(A, B, [r, s], "r", "n")

A*r+B*s

(13)

Test3(A, B, "r", "n")

A*x+B*y

(14)

Test3(A, B, "n", "r")

A*x+B*y

(15)

NULL


 

Download Q_2024-02-25_Test_proc_Args.mw

First 8 9 10 11 12 13 14 Last Page 10 of 2097