dharr

Dr. David Harrington

8240 Reputation

22 Badges

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

Your two variables are many orders of magnitude apart, so you need to force full precision calculations using the fulldigits option, and you need to help by specifying a much narrower search range for p

fsolve({hyper_p31(lambda, 4, 2, 1.0*10^10)-p = 0, `hyper_λ31`(p, 4, 2, 1.0*10^10)-lambda = 0},
 {lambda = 0 .. 1, p = 0 .. 0.1e-5}, fulldigits)

test_temp.mw

A 3d plot is a good way to get an overall picture. 

plot3d(z,x=-1..1,y=-1..1,style=surfacecontour);

If you want specific z values for your contours, you can use the contours option:

plot3d(z,x=-1..1,y=-1..1,style=surfacecontour,contours=[-30,-20,-10,0,10,20,30,40]);

 

I think you wanted print(p) in B. But I agree there are no output plot files generated. (I'm using Maple 2015.) I usually use the interface command to do these plot outputs rather than plotsetup, e.g., interface(plotdevice=ps, etc), and maybe that is a clue. I'm guessing that since it is running headless, that means that none of those interface features work, and so plots cannot be output in this way.

You have 3 equations but have specified only one unknown. You should specify which three variables to solve for; then you will get these three in terms of the other variables. For example you get a solution with

solve({eq1, eq2, eq3}, {xk,xk1,xk2});

 

I would use implicitplot for this. I'm assuming z is a complex variable.

restart; with(plottools); with(plots)

 

In John Stillwell's book "The Four Pillars of Geometry" he declares the following to be the equations of non-Euclidean "lines" where A,B and C are all non-zero


What Maple code will plot this equation for given values of A, B and C?

Equation := A*z*conjugate(z)+B*(z+conjugate(z))+C = 0:

plots:-implicitplot(eval(Equation, {A = 1.5, B = 2, C = -1, z = x+I*y}), x = -3 .. 1, y = -2 .. 2, labels = [Re(z), Im(z)], scaling = constrained);
``

``

 

Download NonEuclideanLines.mw

To get RK4, use dsolve({IC, ODE}, numeric, method=classical[rk4], stepsize=h). See the help page ?dsolve,numeric.

Not sure exactly what you want to do, but you may find the singular command useful, which finds the singularities. You can add the option 'CauchyPrincipalValue' to an integral, e.g., int(1/x^3, x = -1 .. 2, 'CauchyPrincipalValue'). See the ?int,details help page. But as @vv points out, numerical integrals done like evalf(Int(...)) do not work with this option.

The problem is that Maple sees the " as the start of a string, but doesn't find the matching " at the end of the string, so thinks you aren't finished entering your command. You can enter `Trees_aren"t_pink`!; to solve this - this is the factorial of `Trees_aren"t_pink`; or if you wanted the ! to be part of the name then `Trees_aren"t_pink!`;
 

Your last line has add*rhs. Not sure what you want to do, but perhaps:
 

restart;

A := Matrix([[1, 2, 1, 3], [1, 1, 2, 1], [1, -2, 5, -11]]);

cs := LinearAlgebra:-ColumnSpace(A);

cnames := [seq(c || j, j = 1 .. numelems(cs))];

cvals := seq(solve([entries(A[() .. (), k] -~ add(`*`~(cnames, cs)), 'nolist')], cnames)[], k = 1 .. op([1, 2], A));

seq(add(rhs~(cvals[k]) *~ cs), k = 1 .. op([1, 2], A));

 

A := Matrix(3, 4, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 1, (1, 4) = 3, (2, 1) = 1, (2, 2) = 1, (2, 3) = 2, (2, 4) = 1, (3, 1) = 1, (3, 2) = -2, (3, 3) = 5, (3, 4) = -11})

cs := [Vector(3, {(1) = 1, (2) = 0, (3) = 0}), Vector(3, {(1) = 0, (2) = 1, (3) = 0}), Vector(3, {(1) = 0, (2) = 0, (3) = 1})]

cnames := [c1, c2, c3]

cvals := [c1 = 1, c2 = 1, c3 = 1], [c1 = 2, c2 = 1, c3 = -2], [c1 = 1, c2 = 2, c3 = 5], [c1 = 3, c2 = 1, c3 = -11]

Vector(3, {(1) = 1, (2) = 1, (3) = 1}), Vector(3, {(1) = 2, (2) = 1, (3) = -2}), Vector(3, {(1) = 1, (2) = 2, (3) = 5}), Vector(3, {(1) = 3, (2) = 1, (3) = -11})

``


 

Download add.mw

Less for your stacking example, but generally useful is copy(vec) or LinearAlgebra:-Copy(vec), which makes a new copy of the vector (or rtable in general).

e has no special meaning, use exp(), and pi is Pi. (And that integral is definite, since it goes between specific values; I think you mean improper). Now it is fixed, hitting enter on that line executes it.

Download Integral.mw

You can use ListTools:-MakeUnique to remove the duplicates from a list.


 

restart

with(ListTools):

a := [Vector(2, [1, 0]), Vector(2, [2, 0]), Vector(2, [1, 0])]

a := [Vector(2, {(1) = 1, (2) = 0}), Vector(2, {(1) = 2, (2) = 0}), Vector(2, {(1) = 1, (2) = 0})]

MakeUnique(a)

[Vector(2, {(1) = 1, (2) = 0}), Vector(2, {(1) = 2, (2) = 0}), Vector(2, {(1) = 1, (2) = 0})]

MakeUnique(a, 1, LinearAlgebra:-Equal)

[Vector(2, {(1) = 1, (2) = 0}), Vector(2, {(1) = 2, (2) = 0})]

``


 

Download Unique.mw

As @Sauberschrauber says, you probaby want exp rather than  "e", which is a symbol without special meaning. But you also have used "." for multiply rather than "*". There is unlikely to be an analytical solution.

restart

fn1 := int((a-x)*lambda*exp(-lambda*x), x = 0 .. a);

(lambda*a+exp(-lambda*a)-1)/lambda

fn2 := `assuming`([int((a-x)*lambda*exp(-lambda*x), x = a .. infinity)], [positive]);

-exp(-lambda*a)/lambda

f2 := sum((b1*fn1+b2*fn2)/lambda, lambda = 1 .. c);

b1*a*Psi(c+1)+b1*a*gamma-(exp(a)*LerchPhi(exp(-a), 2, c)*exp(-(c+1)*a)*c^2-polylog(2, exp(-a))*c^2-exp(-(c+1)*a)*exp(a))*b1/c^2+b1*Psi(1, c+1)-(1/6)*b1*Pi^2+(exp(a)*LerchPhi(exp(-a), 2, c)*exp(-(c+1)*a)*c^2-polylog(2, exp(-a))*c^2-exp(-(c+1)*a)*exp(a))*b2/c^2

df2 := diff(f2, a);

b1*Psi(c+1)+b1*gamma-(exp(a)*LerchPhi(exp(-a), 2, c)*exp(-(c+1)*a)*c^2-exp(a)*exp(-a)*(LerchPhi(exp(-a), 1, c)/exp(-a)-c*LerchPhi(exp(-a), 2, c)/exp(-a))*exp(-(c+1)*a)*c^2+exp(a)*LerchPhi(exp(-a), 2, c)*(-1-c)*exp(-(c+1)*a)*c^2-ln(1-exp(-a))*c^2-(-1-c)*exp(-(c+1)*a)*exp(a)-exp(-(c+1)*a)*exp(a))*b1/c^2+(exp(a)*LerchPhi(exp(-a), 2, c)*exp(-(c+1)*a)*c^2-exp(a)*exp(-a)*(LerchPhi(exp(-a), 1, c)/exp(-a)-c*LerchPhi(exp(-a), 2, c)/exp(-a))*exp(-(c+1)*a)*c^2+exp(a)*LerchPhi(exp(-a), 2, c)*(-1-c)*exp(-(c+1)*a)*c^2-ln(1-exp(-a))*c^2-(-1-c)*exp(-(c+1)*a)*exp(a)-exp(-(c+1)*a)*exp(a))*b2/c^2

ans := solve(df2, a);

RootOf(_Z*c-ln(-(LerchPhi(1/exp(_Z), 1, c)*b1*c-LerchPhi(1/exp(_Z), 1, c)*b2*c-b1+b2)/(c*(b1*ln(exp(_Z)-1)-b2*ln(exp(_Z)-1)+b1*gamma+b1*Psi(c+1)-b1*_Z+b2*_Z))))

evalf(eval(ans, {b1 = .9, b2 = .1, c = 3}));

-0.7104876251e-1

If value of c is known, say 3, then

f3 := add((b1*fn1+b2*fn2)/lambda, lambda = 1 .. 3);

b1*(a+exp(-a)-1)-b2*exp(-a)+(1/2)*b1*(a+(1/2)*exp(-2*a)-1/2)-(1/4)*b2*exp(-2*a)+(1/3)*b1*(a+(1/3)*exp(-3*a)-1/3)-(1/9)*b2*exp(-3*a)

df3 := simplify(diff(f3, a));

-b1*exp(-a)+(11/6)*b1+b2*exp(-a)-(1/2)*exp(-2*a)*b1+(1/2)*b2*exp(-2*a)-(1/3)*exp(-3*a)*b1+(1/3)*b2*exp(-3*a)

This is a polynomial in exp(-a)=y

solve(y = exp(-a), a);

-ln(y)

-b1*y+(11/6)*b1+b2*y-(1/2)*y^2*b1+(1/2)*b2*y^2-(1/3)*y^3*b1+(1/3)*b2*y^3

(1/2)*((27*b1-5*b2+2*(189*b1^2-81*b1*b2+13*b2^2)^(1/2))*(b1-b2)^2)^(1/3)/(b1-b2)-(3/2)*(b1-b2)/((27*b1-5*b2+2*(189*b1^2-81*b1*b2+13*b2^2)^(1/2))*(b1-b2)^2)^(1/3)-1/2, -(1/4)*((27*b1-5*b2+2*(189*b1^2-81*b1*b2+13*b2^2)^(1/2))*(b1-b2)^2)^(1/3)/(b1-b2)+(3/4)*(b1-b2)/((27*b1-5*b2+2*(189*b1^2-81*b1*b2+13*b2^2)^(1/2))*(b1-b2)^2)^(1/3)-1/2+((1/2)*I)*3^(1/2)*((1/2)*((27*b1-5*b2+2*(189*b1^2-81*b1*b2+13*b2^2)^(1/2))*(b1-b2)^2)^(1/3)/(b1-b2)+(3/2)*(b1-b2)/((27*b1-5*b2+2*(189*b1^2-81*b1*b2+13*b2^2)^(1/2))*(b1-b2)^2)^(1/3)), -(1/4)*((27*b1-5*b2+2*(189*b1^2-81*b1*b2+13*b2^2)^(1/2))*(b1-b2)^2)^(1/3)/(b1-b2)+(3/4)*(b1-b2)/((27*b1-5*b2+2*(189*b1^2-81*b1*b2+13*b2^2)^(1/2))*(b1-b2)^2)^(1/3)-1/2-((1/2)*I)*3^(1/2)*((1/2)*((27*b1-5*b2+2*(189*b1^2-81*b1*b2+13*b2^2)^(1/2))*(b1-b2)^2)^(1/3)/(b1-b2)+(3/2)*(b1-b2)/((27*b1-5*b2+2*(189*b1^2-81*b1*b2+13*b2^2)^(1/2))*(b1-b2)^2)^(1/3))

But for c larger than 5, there won't be a symbolic solution, as you wanted.

``

Download solve.mw

I don't know why this would be - after all, 0.12 as an expression outputs as 0.12. If you care about exactly how the number is formatted, you can write it to a string using a format: sprintf("%f",0.12); gives "0.120000" and you can have fine control over number of digits etc by adjusting the format - see the help page ?sprintf.

I'm having the same issue (in Maple 2015). It seems you have to browse to a worksheet even if it is the open one with the bookmark in that you are editing. (I selected type worksheet and absolute path.) The help says you can leave it blank if it is the current worksheet, but this seems not to be the case.

First 46 47 48 49 50 51 52 Last Page 48 of 81