dharr

Dr. David Harrington

8455 Reputation

22 Badges

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

I added an explicit multiplication between )( in the middle of ODE1, I changed D(f)(0)^2 to (D@@2)(f)(0) (not sure what you wanted), and removed Digits:=3. (You want full hardware precision here). Now it is producing output.

FDM_EYRING_POWELL2.mw

One of the examples on the help page shows how to do this.

L := Split("This string has some    extra 		whitespace    in it.");
remove(type, L, "");

 

You didn't upload your worksheet (green up-arrow), so I can't be sure, but I'd guess that you are using the default 2D math and have an extra space between p and (T)=0 i.e. p (T) instead of p(T). The extra space means it is interpreted as multiply rather than as a function. (The error message says pT=0 as though p is multiplied by T).

or perhaps you mean p(0)=0? The variable T isn't mentioned.

Edit:

See Carl's answer.

Most of your examples are polynomials, for which the following works fairly simply. It fails your last two non-polynomial examples, but probably could be fixed with something like frontend or freeze/thaw.

common_factor:=proc(x,z)
  local xn:=x^ldegree(collect(z,x),x);
  if rem(z,xn,x)=0 then xn*quo(z,xn,x) else z end if;
end proc;

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

First 47 48 49 50 51 52 53 Last Page 49 of 83