Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi, someone help please. How I can fix the following problem (preferably avoiding for-loops as they are too slow):

From a family of subsets (say) S={{a,b},{a,b,c},{b,c},{c}} of the set X={a,b,c}
1). Extract all the subsets i.e. members of S, which have 'a' as their member?
2). For any (a,b) in X x X, check if 'a' is member of all those subsets which have 'b' also as their member or not?
 

I have few questions on this subject.

1) One can view internal maple procs using the command showstats. For example showstat(`dsolve`) prints the dsolve proc. And showstat(`dsolve/SERIES`)  prints the proc called  dsolve/SERIES(). And this i s what I do not understand. What is the signifcance of in the above?    Since dsolve itself is a proc, what does mean? does this means SERIES is an internal proc inside dsolve proc? That is not likely. I see things like convert/tan/simpler again, what does the mean here? it can't be that simpler is an inner proc inside tan proc which is inside convert proc? I never used /  myself in mycode in a proc name.

How are these procs organized physically? I mean inside Maplesoft computers. Is each proc in separate .mpl file? How does the /  comes into play?  I tried to make a proc myself with forward / but got syntax error. So this / must mean some other logical relation, but I do not know to emulate it myself.

 

2) Why one must add ` ` around the names when using showstats for system procs, but not for my own module? For example, I did the following

A:=module()
  export foo:=proc()
      NULL;
  end proc;
end module;
                    
showstat(A:-foo)

And that worked. But if I type showstat(`A:-foo`)  maple gives error Error, (in showstat) procedure name expected

but with system proc, must have the `` there. If I type showstat(convert/tan/simpler) it is an error.

 

3) Why showstat(`DEtools/odeadvisor`)  gives Error, (in showstat) procedure name expected? But help says odeadvisor is in DEtools module.

 

4) Why can't one display the source of the module itself, and it has to be a proc? For example showstat(`DEtools`) gives error, because `DEtools` is not a proc, but a whole module.

Are these things described more somewhere? I only know about with(LibraryTools); 
Browse(); 

I am using GraphTheory:-AutomorphismGroup() command in order to obtain all the automorphisms of a graph. However, the command appears to return a set of generators. How can I get all the automorphisms listed?

Here is an example of my work.

with(GraphTheory)

AutomorphismGroup(CycleGraph(4))

_m4568996768

(1)

NULL

Download auto.mw

Vectorial ODEs and vectorial integration constants

In physics, it is traditional to work with vectors, as in analytic geometry, i.e. symbolic vectors, abstract as in `#mover(mi("A"),mo("→"))`, or projected into orthonormal basis such that the unit vectors appear explicitly. In Maple, that is implemented by the Physics:-Vectors  package. The underlying idea is the extension of the Maple computational domain to include a new category of objects: vectors, and related unit vectors and vectorial differential operators all based on `≡`(Nabla, VectorCalculus[Nabla]).

 

But then, with paper and pencil, we frequently write vectorial differential equations, that when solved imply on vectorial integration constants, none of which were implemented; now they are, within the Maplesoft Physics Updates v.1341. As with everything new, there is more work to be done, mainly additional checks for consistency here and there, but the work is advanced; time to tell the story and we are grateful in advance for the always useful opinions / corrections if any.

 

The input/output below illustrate the new features, which by the way compose on top of the new subscripted arbitrary constants by dsolve; this time extended to also be vectorial. The presentation has for context typical material of a first undergrad course in Mechanics. The purpose, anyway, is only to illustrate the new solving of vectorial differential equations and vectorial integration constants.

NULL

Download Vectorial_ODEs_and_integration_constants.mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

anyone has smart tricks to verify this Maple solution to this first order ode? I think the solution is correct. But can't figure how to make odetest result simplify to zero.

restart;
ode:=diff(y(x),x)=x*(y(x)^2-1)^(2/3);
sol:=dsolve(ode);
odetest(sol,ode);
coulditbe(%=0);

I tried few simplification on the output of odetest to see if will become zero, but no success.  This is one of those solutions which is hard for odetest to show it is zero because of the signum there, so thought to ask, may be someone will find a smart trick.

Maple 2022.2 on windows 10.

if isolate fail, then it returns back the input equation. But if solve failed to solve for the variable in question, it returns either NULL or empty list, or empty set (depending on the input). So it is easy to check if it failed or not.

How does one check that isolate failed? Should I check the left side of what isolate returns is the variable I am solving for? For an example,

sol:=isolate(-2*y-cos(y)+x+sin(x)-_C1 = 0,y)

returns back -2*y-cos(y)+x+sin(x)-_C1 = 0

Is the following the correct way to check if isolate solved the equation or not:

sol:=isolate(-2*y-cos(y)+x+sin(x)-_C1 = 0,y);
if lhs(sol)=y then
   print("it solved it. Soltion is ",sol);
else
   print("Failed to solve it. Try solve command now ");
fi;

Just wanted to make sure as help for isolate does not mention anything about what happens if isolate can't solve the equation.

Maple 2022.1

Hi,

So I have two issues currently. One is involved with units, and the other is involved in this preculiar issue I have with a solve.

The units issue is probably pretty simple. I tried converting the units to the more readable prefix unit (ex: nanofarads instead of farads). The conversion worked, as in the number changed, but the unit in the output didn't. How do I fix that?

The second issue is that I have a solve execution like above to solve for some resistor values. The problem is, for some reason, it's not actually giving me an output. I have no idea why, what am I doing wrong?

LLC_converter.mw

Hi,
I want to calculate the Taylor expansion of an expression with Maple, but there is an error. How can I fix it?
T.mw
Thanks

I would like to place a legend between the axes and the image, but there is no such place in the positions given by the software. How to do it?

restart;
with(plots):
_local(D):

EQ := proc(M, N) local eq; eq := (y - M[2])/(x - M[1]) = (N[2] - M[2])/(N[1] - M[1]); end proc;
     EQ := proc (M, N) local eq; eq := (y-M[2])/(x-M[1]) = 

        (N[2]-M[2])/(N[1]-M[1]) end proc


On considère un trapèze dans lequel une base est fixe l'autre base a une longueur constante et la somme des 2 autres côtés est constaante.
Trouver :
1-. le lieu des sommets mobiles.
A := [xA, 0]:
B := [xA + a, 0]:
D := [xD, yD]:
C := [xD + b, yD]:
EQ(B, C);
E := [xA + a - b, 0]:
Omega1 := (A + E)/2;
Application numérique :
Lieux des sommets C et D

xA := -5:
a := 13:#a>=b
b := 7:
c := -3:
xD := -6:
xC := xD + c:

A:
B:
C:
D:
Ll:=11:aa:= Ll/2: 
cc := (a - b)/2:
bb := sqrt(aa^2 - cc^2):
el1 := (x - Omega1[1])^2/aa^2 + y^2/bb^2 = 1:
sol := solve(subs(x = xD, (x - Omega1[1])^2/aa^2 + y^2/bb^2 = 1), y):
yD := sol[1]:
el2 := (x - Omega1[1] - b)^2/aa^2 + y^2/bb^2 = 1:
EL1 := implicitplot(el1, x = -9 .. 4, y = -6 .. 6, color = blue):
EL2 := implicitplot(el2, x = -9 .. 12, y = -6 .. 12, color = blue):
Trap := polygonplot([A, B, C, D], color = blue, filled = true, transparency = 0.9):
Points := pointplot([A[], B[], C[], C[], D[], E[], Omega1[]], symbol = solidcircle, color = [red], symbolsize = 6):
tex := textplot([[A[], "A"], [B[], "B"], [C[], "C"], [D[], "D"], [E[], "E"], [Omega1[], "Ω1"]], align = ["above", "right"]):
display([Trap, EL1, EL2, tex, Points], axes = normal, scaling = constrained):
Fig := proc(xD) 
local yD, D, C,Points,tex; 
global A, B, b, Omega, xA, xB, EL1, EL2; 
solve(subs(x = xD, (x - Omega1[1])^2/aa^2 + y^2/bb^2 = 1), y); 
yD := %[1]; D:= [xD, yD]; C := [xD + b, yD];
Points := pointplot([A[], B[], C[], C[], D[], E[], Omega1[]], symbol = solidcircle, color = [red], symbolsize = 6): 
tex := textplot([[A[], "A"], [B[], "B"], [C[], "C"], [D[], "D"], [E[], "E"], [Omega1[], "Ω1"]], align = ["above", "right"]):
display([polygonplot([A, B, C, D], color = blue, filled = true, transparency = 0.9), Points,tex,EL1, EL2], axes = normal, scaling = constrained); 
end proc:

Fig(2):Fig(-4):
Fig([seq(-6 + 3*i/10), i = 1.20], insequence = true);
Error, (in Engine:-Dispatch) badly formed input to solve: not fully algebraic
;I don't understand this error message. Thank you gfor your help.
 

I recently upgraded from Maple 2019.2 directly to Maple 2022.2. I now have a problem with any double or triple literal subscripted variable in old worksheets or in new ones under Maple 2022.2. Double and triple indexed subscripts work just fine under Maple 2019.2.

If in Maple 2022.2 I enter X__a I get a proper Xa.  If I enter Y__a,b I get 'Ya,b' Note the leading prime preceeding the Y and the trailing prime following the subscript b down at the subscript level. This behavior holds for triple literal subscripts.

On the other hand, indexed subscripts work just fine in Maple 2022.2. If I enter X[a] I get Xa. If I enter Y[a, b] I get Ya,b .

How do I fix this behavior? When did it start? My jump from Maple 2019.2 to Maple 2022.2 was due to changing companies during the Covid period. I am using Maple on a Mac.

I have not tested literal superscripts or combinations of literal subscripts and superscripts.

Any help will be greatly appreciated. I use literal double and triple suscripts all the time to distinguish between vector and matrix components in different coordinate systems.

Neill Smith

Hello everyone,

I am trying to solve a system of 4 ODEs that describe a physical system, however, I get the message:

Error, (in dsolve/numeric/bvp) matrix is singular

Any help is much appreciated. The initial conditions are such that to find solution in steady state, that means, v(0)=v(period) and so on with all variables.

Download LLCcircuit_SteadyState_numerical.mw

Hello everyone,

I want to solve a simple ODE numerically having a piecewise periodic function in the ODE.

The periodic piecewise function definition is taken from this  post.

When solving using "dsolve" numerical, I get this error:

Error, (in f) unable to store '100000*square_wave_periodic' when datatype=float[8]

restart;
d := .5;
fs := 100*10^3;
Vin := 10;
C := 10*10^(-6);
R := 10;
L := 10*10^(-6);

DEFINE PERIODIC FUNCTION
square_wave := proc (t) options operator, arrow; piecewise(0 <= t and t <= d/fs, Vin, d/fs < t and t < 1/fs, 0) end proc

square_wave_periodic := proc (t) options operator, arrow; square_wave(t-floor(t*fs)/fs) end proc

ode1 := L*(diff(i(t), t))+v(t) = square_wave_periodic
ode2 := C*(diff(v(t), t))+v(t)/R = i(t)
IC := v(0) = 0, i(0) = 0
sol := dsolve({IC, ode1, ode2}, {i(t), v(t)}, numeric)

LCRcircuit_transient_numerical.mw

Any help is much appreciated ! Thank you !

Good day. 

I have been looking into the time series features in Maple and was eager to apply the models to one specific example containing 47 data points (attached).

When I run the ESM routine, Maple provides a forecast based on a (A,N,N) configuration. You will notice that the forecast for the following 12 data points is a constant value. I have also noticed this for several other data set examples and I would have expected the predictions to vary across the next 12 data points.

Does the (A,N,N) configuration in Maple automatically provide an optimal forecast and can anyone advise me on how to specify all possible combinations of (error, trend, season) models?

Thanks you for reading.

MaplePrimes_TS_Example.mw

solve((&PartialD;(-    &nabla;(f) ))/(&PartialD; t)+((DotProduct(v[0],&nabla;f))*(1-e(DotProduct(B,Omega)))+(c[s0]^(2)*rho[1])/(rho[0])(1-e(DotProduct(B,Omega)))+e(CrossProduct(&nabla; f,B))*Omega-e((DotProduct(-&nabla;f,Omega))*(DotProduct(B,&nabla;)))*(-&nabla;f)+e(E)*(1-(DotProduct(B,Omega)))+e^(2)(DotProduct(E,B))*Omega-e*((CrossProduct(E,Omega))*(&nabla;(-&nabla;f)),rho[1]);

First 264 265 266 267 268 269 270 Last Page 266 of 2218