dharr

Dr. David Harrington

5712 Reputation

21 Badges

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

Social Networks and Content at Maplesoft.com

I am a professor of chemistry at the University of Victoria, BC, Canada, where 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

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, `ε` = .4, R[d] = .7}

G := (1+4*R[d])*(diff(g(x), `$`(x, 2)))-Sh*sin(alpha)*g(x)^2-(Nc*(1-`ε`)+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

 

Since your equations are linear, I converted them to Matrix form, then LinearSolve reports that the system is inconsistent. Note that the determinant of your matrix is zero and the rank is only 12. (I assume that eq[16] being the only one with a constant term is correct - but is the constant correct?) So there are relationships between the equations, and perhaps between the original differential equations. Using Nullspace to see what the relationships are between columns of the Matrix doesn't show anything obvious.

Perhaps Maple can solve the system of equations symbolically so it is easier to see what the relationships might be. Or you could set up the differential equations in Matrix form to make it more obvious what is happening.

Timoshenko_Beam.mw

This prints in the same typeface as usual.

restart

Setup so pp(expr) prettyprints expr with "," as decimal separator

pp:=(expr)->Typesetting:-Typeset(expr):
`print/mn`:=x->Typesetting:-mn(StringTools:-Subs("."=",",x)):

q := 1.23+sqrt((1.5+y)/sqrt(sin(1.45)+3.5*x))
pp(%)

Parse:-ConvertTo1D, "invalid input %1", Typesetting:-mprintslash([Typesetting:-mrow(Typesetting:-mn("1,23"), Typesetting:-mo("&plus;"), Typesetting:-msqrt(Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-mn("1,5"), Typesetting:-mo("&plus;"), Typesetting:-mi("y")), Typesetting:-msqrt(Typesetting:-mrow(Typesetting:-mn("0,9927129910"), Typesetting:-mo("&plus;"), Typesetting:-mrow(Typesetting:-mn("3,5"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("x")))))))], [Typesetting:-mrow(Typesetting:-mn("1.23"), Typesetting:-mo("&plus;"), Typesetting:-msqrt(Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-mn("1.5"), Typesetting:-mo("&plus;"), Typesetting:-mi("y")), Typesetting:-msqrt(Typesetting:-mrow(Typesetting:-mn("0.9927129910"), Typesetting:-mo("&plus;"), Typesetting:-mrow(Typesetting:-mn("3.5"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("x")))))))])

NULL

Download comma.mw

I fixed this in a quick-and-dirty way by adding eval at some places (shown in red). If the logic flow changes, you will need more, but it is better to adjust the way you are progamming. You assign expressions with xi in it to variables and then do xi:=1 or similar. Within a procedure there is only one-level evaluation so this does not automatically change the value of the variables. You should use say, xi1:=1, then eval(something with xi in it, xi = xi1).

SiS_Quadratic_(goal).mw 

(I only tested to the line FirmModelH(0.8, 0.15, 0.15, 0.10)[3])

Check how this simpler code works:

test:=proc(a) local xi, q, q2;
  q:=a*xi;
  xi:=2;
  q2:=eval(q);
  return q,q2;
end proc:

test(3);

gives 

Not sure I entirely understand the details of what you want. I used blue axes, but if you want arrow axes with better-positioned labels you could use axes=none and make your own with arrow and textplot3d. (Proportions look better in the worksheet.)

``

restart

with(plots); with(plottools)

``

cuboid1 := cuboid([0, -2, -4], [10, 2, 4], color = "red", style = wireframe); ell := textplot3d([5, 0, -4.5, "&ell;"], align = below, color = "blue", font = [Times, italic, 20]); text_inside := textplot3d([5, 0, 0, typeset(Q(x, z, t) = Q[0]*delta(-t*v+x)*sin(p*z))], align = below, color = "green", font = [Times, italic, 16]); display(cuboid1, text_inside, ell, scaling = constrained, axes = normal, axis = [color = "blue"], view = [-1 .. 12, -6 .. 6, -6 .. 6], orientation = [-80, 80], labels = [x, y, z], tickmarks = [0, 0, 0], labelfont = [Times, italic, 16])

 

NULL

Download rectangular_cylinder.mw

The whole system of all 8 equations can all be solved at once. You did not have a value for the "omegat" parameter, so I arbitrarily set that to 1. You also had a error in setting values for parameters at the beginning of the sheet, but since that line was redundant, I just removed it.

 New.mw

I didn't track it down exactly, but it is related the the fact that rotations of [1,2,...,n] considered as permutations all have even parity if n is odd, but have alternating odd, even, parity if n is even (see in attached). The transpose of the adjoint is the matrix of cofactors, which are (-1)^(i+j) times the determinant of the minor, and the signs of the terms in the determinant have signs depending on the parity of the permutation of the indices. So in using rotations sometimes you have alternating signs and don't need your matrix P for the (-1)^(i+j) , and sometimes you don't have alternating signs, so need P. 

The attached is mainly me figuring out what you were doing by translating to the language of permutation matrices.

Adjoint.mw

I think @acer mentioned using a plot component. Here is an implementation of that. Run the worksheet then follow the instructions. There is code in the reset button click event handler and the plot click event handler.

Rename DealeyPlaza.txt to DealeyPlaza.jpg

DealeyPlaza.txt

MeasureImage.mw

3 4 5 6 7 8 9 Last Page 5 of 61