dharr

Dr. David Harrington

8200 Reputation

22 Badges

20 years, 335 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

As far as I know, Maple cannot work with matrices of an unspecified (abstract) size. You can get the inverse by working from its definition in terms of the adjugate; Maple's help system gives the definition.
Find the Jacobian, say using: with(plots):with(LinearAlgebra):with(VectorCalculus): LV := [diff(x(t), t) = 0.2e-1*x(t)-0.5e-2*x(t)*y(t), diff(y(t), t) = 0.1e-1*x(t)*y(t)-0.1e-1*y(t)]: map(rhs,LV):subs(x(t)=X,y(t)=Y,%): J:=Jacobian(%,[X,Y]); Then find the eigenvalues as a function of x(t) and y(t): ev1,ev2:=subs(X=x(t),Y=y(t),Eigenvalues(J,output=list))[]; Solve the odes for some set of initial conditions (I'm assuming you want a numerical solution): ans:=dsolve({LV[],x(0)=1,y(0)=0.2},{x(t),y(t)},numeric); And then plot things using odeplot, e.g., for ev1 as a function of time: odeplot(ans,[t,ev1],t=0..10); If you want numerical values, e.g. ev1 at t=5: subs(ans(5),ev1);
Construct your matrix M and then use collect(M,beta);
For example, f:=x->2*x; # simple function with some negative values plot(f(x), x = -10 .. 10, -10 .. 10, axis = [mode = log]); plots (in Maple 10) a nice log-log plot, but only from 10^(-6) to 10^1, since log of a negative number is not defined.
Perhaps you have some particular functions in mind? But in the general case: A:=int(int(F(u)*G(u,v),v=0..infinity),u=0..max); B:=int(F(u)*int(G(u,v),v=0..infinity),u=0..max); then simplify(A-B); returns 0, indicating they are the same. Is this what you meant?
See the help page on convert,base
You are right that Maple's densityplot seems not to accept polar coordinates (using coords=polar). You can get it to work by converting to cartesian and then restricting to the section you want. So to do the 3px orbital and look at the section through the x-y plane you would convert to cartesian coordinates and then set z=0. (My Orbitals package, available from the applications centre, has commands to simplify this and gives an example of a density plot in the ?Orbitals,plots help page (though you need to square it to get the probability density)). As you note, there will not be a density plot in spherical coordinates because you can only plot surfaces in 3D. If you don't want the density of a planar section of the wavefunction, but, say, one of those random dot pictures, then you would have to generate the dots using the probability and plot using pointplot3D.
This problem of wanting the sin(theta) form bugged me in 1992, when I first wrote my Orbitals package (available on the applications centre ). If you are just headed to the spherical harmonics, the usual form is generated by routine Y in that package. I bypassed Maple's LegendreP routine. (I wrote my own associated Lengendre routine, but as I recall that was because at the time LegendreP only accepted numeric degree and order, not because it was easier to get the sin theta form). Basically once you have a function of cos(theta) only, you are doomed to have square roots and then the problems you encountered. The solution for the spherical harmonic is to do it by hand and define it in terms of cosines AND sines.
Going from the equation to the ode is easier: > eq:=m^2+4*m+5: > solve(eq,m); -2 + I, -2 - I > oper:=map(x->lcoeff(x)*D@@degree(x),eq); oper := @@(D, 2) + 4 D + 5 (() -> args) > oper(y)(x); @@(D, 2)(y)(x) + 4 D(y)(x) + 5 y(x) > dsolve(oper(y)(x),y(x)); y(x) = _C1 exp(-2 x) sin(x) + _C2 exp(-2 x) cos(x) If you like the diff form rather than the D form, then convert(oper(y)(x),diff); Note that making m into D by subs(m=D,eq) doesn't work beacuse ^2 is not the same as @@2. Going the way you want (if the above isn't useful) could probably be done with a lot of "op" code; the problem is really that the first derivative and y(x) terms need to be treated differently since they have different types.
eval (or subs) can do this, e.g., de:=diff(x(t),t,t)=-k*x(t); ans:=rhs(dsolve(de,x(t))); subs(_C1=C[1],_C2=C[2],ans); eval(ans,{_C1=C[1],_C2=C[2]}); but if you know the initial condition that gives the constant, you can circumvent this dsolve({de,x(0)=C[2],D(x)(0)=C[1]*sqrt(k)},x(t)); I admit I cheated on the C[1] by looking at the answer without the intial conditions, but the C[2] one is more obvious.
eq1:=sin(tan(a)^2+1/tan(b)); convert(eq1,sincos); will do what you want. You can also convert exclusively to sin or cos.
A less flexible option (because you don't get to choose the filenames) is just to export the worksheet to HTML, choosing the GIF option and images directory "images". Then all your plots are in the images directory as gifs; you just have to find which is which.
The numeric form of dsolve gets stuck on the RootOf also. You can get round this by providing a procedure to solve for dVdt that uses fsolve. See the worksheet View 127_non-linear ODE.mw on MapleNet or Download 127_non-linear ODE.mw
View file details
In general you need as many initial/boundary conditions as the order of the highest derivative, e.g., if n+B=3 (and n is less than or equal to 3) then you need 3 conditions and you only have one, V(0)=0. What happens if n and n+B are not integers is not clear to me.
You can control the number of digits displayed in floating point calculations with, e.g., interface(displayprecision=5); This example doesn't seem to have too much loss of significance, but you can always carry your results through with rationals, and then at the end use evalf(M) to see the floating point form.
First 76 77 78 79 80 81 Page 78 of 81