dharr

Dr. David Harrington

8205 Reputation

22 Badges

20 years, 337 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

Social Networks and Content at Maplesoft.com

Maple Application Center
I am a retired professor of chemistry at the University of Victoria, BC, Canada. My research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

MaplePrimes Activity


These are answers submitted by dharr

SubgroupLattice reports 1431 subgroups, but gives a warning that perfect subgroups may be missing

restart;

with(GroupTheory):

G:=SymmetricGroup(6);

_m2603493461024

L:=SubgroupLattice(G);

Warning, group is not solvable and soluble residual has order >= 360; perfect subgroups may be missing from lattice.

"GroupTheory:-SubgroupLattice(module() ... end module)"

List:=convert(L,list):nops(%);

1431

Choose a group - generator is given as shorthand

G2:=List[321];

_m2603594640096

Elements(G2);

{_m2603495175360, _m2603495644000, _m2603599152640, _m2603599172544}

 

Download S6.mw

Aside from maplemint, in more recent Maple versions if you write code in the startup code region, you get similar information in the diagnostics panel. For example running the code

Q:=proc(x) dsolve(y,method=rkf45) end;

gives:
Info: Line 1: These parameters were never used: x
Info: Line 1: These names were used as global names but were not declared: y
Info: Line 1: These names were used as global names but were not declared: method
Info: Line 1: These names were used as global names but were not declared: rkf45

For future reference, please upload your worksheet using the green up-arrow in the Mapleprimes editor. Maple does give that complicated solution, so you can put in numerical parameters and make various plots, even if it is not so easy to view the solution. If you want a better view of the structure of the solution, here is one way to analyze that.

Download solve.mw

Edit: the solution may look simpler depending on the order in which Maple goes about solving the system. If manipulating this to the simplest form is important, you can experiment by specifying the variable order that PolynomialSystem uses by putting the variables in a list (in a set as here Maple tries to find a nice order). But Maple can handle the complicated solution so long as you don't need to print it out, so a lot depends on what you want to do with the answer.

If I understand correctly, you need a pattern that visually identifies the orientation of a sphere. Perhaps the plot3d color function may be sufficient for your requirements.

ball:=plot3d(1, 0..2*Pi, 0..Pi,coords=spherical,style=surface,axes=none,
 color=proc(theta,phi)
                  if phi>Pi/4 then
                    if theta>Pi then 0.15 else 0.5 end if
                  else
                    if theta>Pi then 0.75 else 1 end if
                 end if
       end proc):
plots:-display(seq(plottools:-rotate(ball,0,0,angle),angle=0..2.*Pi,Pi/10.),insequence);

Download ball.mw

TABLE should be table.

TABLE is a function call that has no special meaning to Maple, but when you assign to the indexed name you make a new table (but I don't understand why the first output has table rather that TABLE).

Download TABLE.mw (change TABLE to table and it works as expected)

Edit: I see TABLE is an undocumented name, reserved for internal use, see ?UnDocumentedNames .

It looks like you can choose homogeneous, but not subtypes of homogeneous, Abel but not subtypes of Abel, etc. It seems the subtypes are chosen automatically.

restart;

ode:=diff(y(x),x)*y(x)+a*x*y(x)+b*x^3=0;
DEtools:-odeadvisor(ode);

(diff(y(x), x))*y(x)+a*x*y(x)+b*x^3 = 0

[[_homogeneous, `class G`], _rational, [_Abel, `2nd type`, `class A`]]

sol:=dsolve(ode,[Abel]): #in list below; no error; gives solution

sol:=dsolve(ode,[homogeneous_B]); #in list; no error; no solution

infolevel[dsolve]:=5;

5

sol:=dsolve(ode,[homogeneous]);

Classification methods on request

Methods to be used are: [homogeneous]

----------------------------

* Tackling ODE using method: homogeneous

--- Trying classification methods ---

trying homogeneous types:

trying homogeneous G

<- homogeneous successful

y(x) = RootOf(2*_Z^2-exp(RootOf(x^4*(tanh((1/2)*(a^2-8*b)^(1/2)*(-4*c__1+_Z+4*ln(x))/a)^2*a^2-8*tanh((1/2)*(a^2-8*b)^(1/2)*(-4*c__1+_Z+4*ln(x))/a)^2*b-a^2-8*exp(_Z)+8*b)))+b+_Z*a)*x^2

I'm guessing the choices have to be in this set, which would suggest you cannot limit it to homogeneous G - it probably looks at the symmetry and knows to use class G; similarly with Abel you do not get to choose 2nd type or class A

`dsolve/keywords`;

{80, 81, `0F2`, `1F2`, `2F2`, `3F2`, Abel, Bessel, Bessel2, Chini, Euler, HINT, Heun, HeunB, HeunC, HeunD, HeunG, HeunT, Kovacic, Kummer, Lie, Mathieu, MeijerG, RIF, RNF, Riccati, Riemann, abaco1, abaco2, all, basis, can, can2, class, coeffs, con_sym, dif, diffalg, exact, exp_sym, fat, formal, fourier, gon, gon2, hyper3, ivars, k25, laplace, lin_sym, linear, missing, mu, mu_x_y1, mu_xy, mu_xy_2, mu_xyp, mu_xyp2, mu_y1, mu_y2, mu_y_y1, numeric, output, pFq, pdsolve, pot_sym, rifsimp, series, singsol, special, sym_1, sym_8, sym_pat, type, useInt, useint, way, Abel_AIL, Abel_AIR, Bernoulli, JacobiSN, Legendre, Liouville, `S-function`, WeierstrassP, Whittaker, Whittaker_old, arbitrary, coeff_type, const_coeffs, cylindrical, dAlembert, elliptic, exact_linear, exact_nonlinear, exp_reduce, explicit, formal_series, formal_solution, fouriercos, fouriersin, homogeneous, homogeneous_B, hypergeom, hypergeom1, hypergeom2, hypergeometric, implicit, inverse_Riccati, inverse_linear, linear_1, linear_patterns, linearizable, mhypergeom, mu_formal, mu_heuristic, mu_poly_yn, parametric, patterns, polynomial, quadrature, rational, reducible, separable, sym_implicit, to_Riccati, to_const_coeffs, DifferentialAlgebra, DifferentialThomas, Riccati_symmetries, WeierstrassPPrime, equivalent_to_Abel, equivalent_to_Bessel, fully_exact_linear, hypergeom_formal_sol, hypergeometricsols, `linear/missing_y`, linear_homogeneous, linear_nonhomogeneous, mhypergeom_formal_sol, mu_xyp_generalcase, mu_xyp_singularcases, nonlinear_homogeneous, rationalize_lode, special_functions, `sym_pat/[F(x)*G(y),0]`, `sym_pat/[F(x)+G(y),0]`, `sym_pat/[F(x),G(x)]`, `sym_pat/[F(x),G(y)]`, with_periodic_functions, exact_linear_nonhomogeneous, `linear_nonhomogeneous_[0,1]`, `linear_nonhomogeneous_[0,F(x)]`, linearizable_by_differentiation, `sym_pat/[F(x),G(x)*y+H(x)]`, mu_xyp2_dynamical_symmetries_fully_reducible, mu_xyp2_dynamical_symmetries_not_fully_reducible}

NULL

Download dsolve.mw

Here's one way. factor on a rational function is supposed to call normal, and normal is supposed to freeze appropriately, so this is surprisingly simple. (I just see your answer - I had asuumed you didn't want to move things to the other side.) I assume you want to cancel x from x^2+x and x^2 and not just the already factored ones. This also cancels common factors from numerator and denominator on each side.

restart;

cancel := proc(eq::`=`);
  local lhseq, rhseq, nums, dens;
  lhseq := factor(lhs(eq));
  rhseq := factor(rhs(eq));
  if lhseq = 0 or rhseq = 0 then return lhseq = rhseq end if;
  nums := factor(numer(lhseq)/numer(rhseq));
  dens := factor(denom(lhseq)/denom(rhseq));
  numer(nums)/numer(dens) = denom(nums)/denom(dens);
end proc:

eq := (y-2*x)^3/((sin(y)-x)^2*(x^2+x)) = a/(x^2*(sin(y)-x)^3)

(y-2*x)^3/((sin(y)-x)^2*(x^2+x)) = a/(x^2*(sin(y)-x)^3)

cancel(eq);

-(-y+2*x)^3/(x+1) = a/((sin(y)-x)*x)

NULL

Download cancel.mw

Correction to your Error.mw worksheet.
Two parameters didn't have values - one because the subscript f got automatically changed to f(x); the other was a typo. For efficiency reasons do not increase Digits. At the default Digits, the equations will be solved at hardware precision, if you ask for higher Digits (typically above 15), you use much slower routines. Changes in red.

Error.mw

Two parameters didn't have values - one because the subscript f got automatically changed to f(x); the other was a typo. For efficiency reasons do not increase Digits. At the default Digits, the equations will be solved at hardware precision, if you ask for higher Digits (typically above 15), you use much slower routines. Changes in red.

Error.mw

You didn't say which version, but in 2023.2.1 it gives the trig form directly. The exp form can be converted using convert(...,trig)

restart

interface(version)

`Standard Worksheet Interface, Maple 2023.2, Windows 10, November 24 2023 Build ID 1762575`

z := int(x^17*cos(x^6), x)

(1/3)*x^6*cos(x^6)+(1/6)*(x^12-2)*sin(x^6)

z2 := collect(convert(z, exp), exp)

((1/6)*x^6+((1/12)*I)*(x^12-2))*exp(-I*x^6)+((1/6)*x^6-((1/12)*I)*(x^12-2))*exp(I*x^6)

simplify(convert(z2, trig))

(1/3)*x^6*cos(x^6)+(1/6)*sin(x^6)*x^12-(1/3)*sin(x^6)

NULL

Download int.mw

This is an answer to the newer, now deleted, question about how to make the subsindets transformer into a one-line procedure.

I think this does what you want. Unfortunately this code only works in 1-D.

subsindets(ex,specfunc(Units:-Unit),q->local un:=indets(q,name);eval(op(q),un=~map(Units:-Unit,un)));

Slightly longer version that works in  2-D is 

subsindets(ex,specfunc(Units:-Unit),proc(q) local un:=indets(q,name); eval(op(q),un=~map(Units:-Unit,un)) end)

Expansion_of_compound_units_shorter.mw

I think this does what you want. Unfortunately this code only works in 1-D.

subsindets(ex,specfunc(Units:-Unit),q->local un:=indets(q,name);eval(op(q),un=~map(Units:-Unit,un)));

Slightly longer version that works in  2-D is 

subsindets(ex,specfunc(Units:-Unit),proc(q) local un:=indets(q,name); eval(op(q),un=~map(Units:-Unit,un)) end)

Expansion_of_compound_units_shorter.mw

It is not unusual for solutions to be independent of some parameters. Here's a simple example

eq1:=(x-a)*(y-b);
eq2:=x^2-b^2;
solve({eq1,eq2},{x,y});

gives

It's not very clear what you want. However you do it, you need dsolve to solve an ODE. In this case there seems to be an exact solution, which you can then write in series form, if that is the objective.

restart

params := {H = 0, Nc = .2, Sh = .5, alpha = (1/2)*Pi, `&epsilon;` = .4, R[d] = .7}

G := (1+4*R[d])*(diff(g(x), `$`(x, 2)))-Sh*sin(alpha)*g(x)^2-(Nc*(1-`&epsilon;`)+Nc+H)*g(x)

(1+4*R[d])*(diff(diff(g(x), x), x))-Sh*sin(alpha)*g(x)^2-(Nc*(1-epsilon)+Nc+H)*g(x)

BCS := g(1) = 1, (D(g))(0) = 0

g(1) = 1, (D(g))(0) = 0

ans := dsolve(eval({BCS, G}, params), g(x))

g(x) = (24/25)*tanh((1/95)*190^(1/2)*x)^2-24/25

series(rhs(ans), x, 5)

series(-24/25+(48/2375)*x^2-(64/225625)*x^4+O(x^6),x,6)

NULL

Download AGM.mw

You were using the old linalg package commands on the newer Matrix (not matrix) objects. I updated to the LinearAlgebra package with the newer commands.

maps.mw

First 22 23 24 25 26 27 28 Last Page 24 of 81