dharr

Dr. David Harrington

8482 Reputation

22 Badges

21 years, 33 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

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

That's quite dramatic! No chugging away for a longtime before losing the kernel as more usually happens. To submit a bug report log in to Mapleprimes, choose the "more" menu, then Submit software change request. In the form there is somewhere to enter additional information, and I often enter the mapleprimes link there (which I copy before I start the form).

The four Appell functions are there, and related functions such as the four Theta functions (JacobiTheta1, etc). For working with q-series and related stuff like Rogers-Ramanujan, see also Frank Garvin's (old-style) Maple packages here

restart;

FunctionAdvisor(function_classes);

[trig, trigh, arctrig, arctrigh, elementary, GAMMA_related, Psi_related, Kelvin, Airy, Hankel, Bessel_related, `0F1`, orthogonal_polynomials, Ei_related, erf_related, Kummer, Whittaker, Cylinder, `1F1`, Elliptic_related, Legendre, Chebyshev, `2F1`, Lommel, Struve_related, hypergeometric, Jacobi_related, InverseJacobi_related, Elliptic_doubly_periodic, Weierstrass_related, Zeta_related, complex_components, piecewise_related, Other, Bell, Heun, Appell, trigall, arctrigall, Polylog_related, integral_transforms]

FunctionAdvisor(Appell);

The 4 functions in the "Appell" class are:

[AppellF1, AppellF2, AppellF3, AppellF4]

FunctionAdvisor(definition,AppellF4);

[AppellF4(a, b, c__1, c__2, z__1, z__2) = Sum(Sum(pochhammer(a, _k1+_k2)*pochhammer(b, _k1+_k2)*z__1^_k1*z__2^_k2/(pochhammer(c__1, _k1)*pochhammer(c__2, _k2)*factorial(_k1)*factorial(_k2)), _k2 = 0 .. infinity), _k1 = 0 .. infinity), abs(z__1)^(1/2)+abs(z__2)^(1/2) < 1]

FunctionAdvisor(Jacobi_related);

The 18 functions in the "Jacobi_related" class are:

[JacobiAM, JacobiCD, JacobiCN, JacobiCS, JacobiDC, JacobiDN, JacobiDS, JacobiNC, JacobiND, JacobiNS, JacobiSC, JacobiSD, JacobiSN, JacobiTheta1, JacobiTheta2, JacobiTheta3, JacobiTheta4, JacobiZeta]

FunctionAdvisor(definition,JacobiTheta1);

[JacobiTheta1(z, q) = Sum(2*q^((_k1+1/2)^2)*sin(z*(2*_k1+1))*(-1)^_k1, _k1 = 0 .. infinity), abs(q) < 1]

NULL

Download qFunctions.mw

It's not clear what you want to plot. I'm guessing eta vs Nr for Nr=0.1, 0.3, 0.6, (for x=0) so there are only 3 points on this plot?

FE-2.mw

 

First 24 25 26 27 28 29 30 Last Page 26 of 83