dharr

Dr. David Harrington

8270 Reputation

22 Badges

20 years, 359 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 trust isolve (?), then there is only one solution, with the tangents 1, 2 and 3. In the figure below tan(A) = 3, tan(B) = 2, tan(C) = 1.

Download tangents.mw

The exponentials are gone in eq22, so it has worked. I assume that after the substitution, the expression with V simplifies so that there is no longer a V.

If fact you can verify this by doing simplify on eq2.

p.s. use indets(eq22,name) to only see the variable names and not more complicated expressions.

@salim-barzani This iterates over all possibilities of mu[1]=0,1;mu[2]=0,1; etc, and is the only way I can make sense of it.

restart

N := 3

3

f0 := exp(add(mu[i]*eta[i], i = 1 .. N)+add(add(mu[i]*mu[j]*B[i, j], i = 1 .. j-1), j = 1 .. N))

exp(B[1, 2]*mu[1]*mu[2]+B[1, 3]*mu[1]*mu[3]+B[2, 3]*mu[2]*mu[3]+eta[1]*mu[1]+eta[2]*mu[2]+eta[3]*mu[3])

mus := Iterator:-BinaryGrayCode(N); muvals := seq({`~`[`=`](seq(mu[i], i = 1 .. N), seq(mui))}, `in`(mui, mus))

_m2021747042624

{mu[1] = 0, mu[2] = 0, mu[3] = 0}, {mu[1] = 1, mu[2] = 0, mu[3] = 0}, {mu[1] = 1, mu[2] = 1, mu[3] = 0}, {mu[1] = 0, mu[2] = 1, mu[3] = 0}, {mu[1] = 0, mu[2] = 1, mu[3] = 1}, {mu[1] = 1, mu[2] = 1, mu[3] = 1}, {mu[1] = 1, mu[2] = 0, mu[3] = 1}, {mu[1] = 0, mu[2] = 0, mu[3] = 1}

add(eval(f0, muval), `in`(muval, muvals))

1+exp(eta[1])+exp(B[1, 2]+eta[1]+eta[2])+exp(eta[2])+exp(B[2, 3]+eta[2]+eta[3])+exp(B[1, 2]+B[1, 3]+B[2, 3]+eta[1]+eta[2]+eta[3])+exp(B[1, 3]+eta[1]+eta[3])+exp(eta[3])

f1 := exp(add(mu[i]*eta[i], i = 1 .. N)+add(add(mu[i]*mu[j]*ln(b[i, j]), i = 1 .. j-1), j = 1 .. N))

exp(mu[1]*eta[1]+mu[2]*eta[2]+mu[3]*eta[3]+mu[1]*mu[2]*ln(b[1, 2])+mu[1]*mu[3]*ln(b[1, 3])+mu[2]*mu[3]*ln(b[2, 3]))

f := simplify(add(eval(f1, muval), `in`(muval, muvals)))

1+exp(eta[1])+b[1, 2]*exp(eta[1]+eta[2])+exp(eta[2])+b[2, 3]*exp(eta[2]+eta[3])+b[1, 2]*b[1, 3]*b[2, 3]*exp(eta[1]+eta[2]+eta[3])+b[1, 3]*exp(eta[1]+eta[3])+exp(eta[3])

Change b[1,2]*b[2,3]*b[1,3] to b[1,2,3], etc.

evalindets(f,`*`,
  proc(term)
    local inds:=indets(term,specindex(b));
    b[op(op~(inds))]*eval(term,inds=~1);
  end proc);

1+exp(eta[1])+b[1, 2]*exp(eta[1]+eta[2])+exp(eta[2])+b[2, 3]*exp(eta[2]+eta[3])+b[1, 2, 3]*exp(eta[1]+eta[2]+eta[3])+b[1, 3]*exp(eta[1]+eta[3])+exp(eta[3])

``

Download formula.mw

In Maple, u[1/2](t) and u[0.5](t) are not the same so you cannot mix them. I changed all the 0.5's to 1/2 and it seems to work now.

error.mw

It's a bug. A workaround is to use

ans := SolveTools:-PolynomialSystem(eqs,
  {p, q, a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], k[1], k[2], k[3], m[1], m[2], m[3]}, explicit)

If I understand correctly, you want to solve the partial differential equation diff(u(x,y,t),t)-diff(u(x,y,t),x)=z. The answer depends on an arbitrary function f__1 at the end. So if you have some boundary or initial conditions you can refine the solution.

restart;

with(PDEtools):

z := 32*delta2^3*(exp((2*a*y*delta2^3 + 2*(x + y + t)^3*(B1 + 2*B2)*delta2^2 + (2*a*delta1^2*y + t)*delta2 + 2*delta1^2*(x + y + t)^3*(B1 + 2*B2))/(delta1^2 + delta2^2)) - exp((-2*a*y*delta2^3 + 4*(B1 + B2/2)*(x + y + t)^3*delta2^2 + (-2*a*delta1^2*y - t)*delta2 + 4*delta1^2*(B1 + B2/2)*(x + y + t)^3)/(delta1^2 + delta2^2)))*a/((delta1^2 + delta2^2)^2*(exp((2*(delta1^2 + delta2^2)*(x + y + t)^3*B2 + 2*delta2*(a*(delta1^2 + delta2^2)*y + t/2))/(delta1^2 + delta2^2)) + exp((2*(delta1^2 + delta2^2)*(x + y + t)^3*B1 - 2*delta2*(a*(delta1^2 + delta2^2)*y + t/2))/(delta1^2 + delta2^2)))^3):

pde:=diff(u(x,y,t),t)-diff(u(x,y,t),x)=z;

diff(u(x, y, t), t)-(diff(u(x, y, t), x)) = 32*delta2^3*(exp((2*a*y*delta2^3+2*(x+y+t)^3*(B1+2*B2)*delta2^2+(2*a*delta1^2*y+t)*delta2+2*delta1^2*(x+y+t)^3*(B1+2*B2))/(delta1^2+delta2^2))-exp((-2*a*y*delta2^3+4*(B1+(1/2)*B2)*(x+y+t)^3*delta2^2+(-2*a*delta1^2*y-t)*delta2+4*delta1^2*(B1+(1/2)*B2)*(x+y+t)^3)/(delta1^2+delta2^2)))*a/((delta1^2+delta2^2)^2*(exp((2*(delta1^2+delta2^2)*(x+y+t)^3*B2+2*delta2*(a*(delta1^2+delta2^2)*y+(1/2)*t))/(delta1^2+delta2^2))+exp((2*(delta1^2+delta2^2)*(x+y+t)^3*B1-2*delta2*(a*(delta1^2+delta2^2)*y+(1/2)*t))/(delta1^2+delta2^2)))^3)

pdsolve(pde,u(x,y,t));

u(x, y, t) = -32*a*((1/2)*exp(2*(y^3+3*(x+t)*y^2+3*(x+t)^2*y+(x+t)^3)*B1-4*(x+y+t)^3*B1)/(exp(2*(x+y+t)^3*B1+2*delta2*x/(delta1^2+delta2^2))+exp(2*(B2*y^3*delta1^2+B2*y^3*delta2^2+3*B2*y^2*delta1^2*(x+t)+3*B2*y^2*delta2^2*(x+t)+3*B2*y*(x+t)^2*delta1^2+3*B2*y*(x+t)^2*delta2^2+B2*(x+t)^3*delta1^2+B2*(x+t)^3*delta2^2+2*y*a*delta1^2*delta2+2*a*y*delta2^3+delta2*(x+t))/(delta1^2+delta2^2)))-(1/4)*(exp(2*(y^3+3*(x+t)*y^2+3*(x+t)^2*y+(x+t)^3)*B1)+exp(2*(x+y+t)^3*B1))*exp(2*(B2*y^3*delta1^2+B2*y^3*delta2^2+3*B2*y^2*delta1^2*(x+t)+3*B2*y^2*delta2^2*(x+t)+3*B2*y*(x+t)^2*delta1^2+3*B2*y*(x+t)^2*delta2^2+B2*(x+t)^3*delta1^2+B2*(x+t)^3*delta2^2+2*y*a*delta1^2*delta2+2*a*y*delta2^3+delta2*(x+t))/(delta1^2+delta2^2)-4*(x+y+t)^3*B1)/(exp(2*(x+y+t)^3*B1+2*delta2*x/(delta1^2+delta2^2))+exp(2*(B2*y^3*delta1^2+B2*y^3*delta2^2+3*B2*y^2*delta1^2*(x+t)+3*B2*y^2*delta2^2*(x+t)+3*B2*y*(x+t)^2*delta1^2+3*B2*y*(x+t)^2*delta2^2+B2*(x+t)^3*delta1^2+B2*(x+t)^3*delta2^2+2*y*a*delta1^2*delta2+2*a*y*delta2^3+delta2*(x+t))/(delta1^2+delta2^2)))^2)*delta2^2*exp(2*delta2*(x+t)/(delta1^2+delta2^2)+4*a*y*delta2^3/(delta1^2+delta2^2)+4*y*a*delta1^2*delta2/(delta1^2+delta2^2)+2*B1*y^3*delta1^2/(delta1^2+delta2^2)+2*B1*y^3*delta2^2/(delta1^2+delta2^2)+6*B1*y^2*delta1^2*(x+t)/(delta1^2+delta2^2)+6*B1*y^2*delta2^2*(x+t)/(delta1^2+delta2^2)+6*B1*y*(x+t)^2*delta1^2/(delta1^2+delta2^2)+6*B1*y*(x+t)^2*delta2^2/(delta1^2+delta2^2)+2*B1*(x+t)^3*delta1^2/(delta1^2+delta2^2)+2*B1*(x+t)^3*delta2^2/(delta1^2+delta2^2)+2*B2*y^3*delta1^2/(delta1^2+delta2^2)+2*B2*y^3*delta2^2/(delta1^2+delta2^2)+6*B2*y^2*delta1^2*(x+t)/(delta1^2+delta2^2)+6*B2*y^2*delta2^2*(x+t)/(delta1^2+delta2^2)+6*B2*y*(x+t)^2*delta1^2/(delta1^2+delta2^2)+6*B2*y*(x+t)^2*delta2^2/(delta1^2+delta2^2)+2*B2*(x+t)^3*delta1^2/(delta1^2+delta2^2)+2*B2*(x+t)^3*delta2^2/(delta1^2+delta2^2))/(delta1^2+delta2^2)+f__1(y, x+t)

``

NULL

Download pdsolve.mw

Here is one way. pointplot has options to control the shape and size of the point. display is used for combining two or more plots. Notice the with(plots) at the beginning. I'm not sure what you mean by "plotting the distance".

 

with(Student:-Precalculus); with(plots)

with(Plot)

a := [1, 3]

b := [5, 6]

Distance(a, b)

5

mp := Midpoint(a, b)

[3, 9/2]

Line(a, b)

y = (3/4)*x+9/4, 3/4, 9/4, -3

Lplot := Line(a, b, output = plot); display(Lplot, pointplot(mp, symbolsize = 12, symbol = solidcircle, color = blue))

 

 

Download How-to-plot-distance-midpoint.mw

For numerical use (not necessarily for plotting), plottools:-rotate rotates an nx3 Array (datatype=float[8]) of points if you enclose it in a CURVES or POLYGONS call. I'm assuming the alpha, beta, gamma are the Euler angles, or closely related. (I've only actually used the other form of plottools:-rotate where you specify 2 points on the rotation axis and one angle.)

Download Euler.mw

This is the same problem as before; perhaps you did not read my response here.

The 19 equations don't have a solution in those variables. You could change variables or use a smaller set of equations, e.g.,

solve(eqs1[1 .. 14], {a[0], a[1], a[2], a[3], a[4], e[1], k[1], n[1], p[1]});

returns solutions.

Y is already used for something else.

N-soliton.mw

In eq5, you are missing a multiplication between the c and the (. Use a space, or better, a * for multiplication. Here c(...) is being interpreted an an unknown function named c, which solve doesn't know anything about.

maple_code_for_disease_equilibruim.mw

To add to @acer's answer, operators with names starting with & automatically are displayed as infix operators. (See the help page ?neutral.) So using &T instead of T will work, though it will display with the &. If you also want it to have a nice symbol output, choose one of the HTML codes that start with "&" and end with ";" (but not in the `&#...;` form; use the entity form). You are probably familiar with these. Many of the symbols on the operator palette are of this form. For example, I like to use

`⊗` := LinearAlgebra:-KroneckerProduct;

and use the palette in 2D input to easily input

On the main page for the app there is an "Attachment" link, separate from the "Download" link, which has a zip file with the library files, called "maple.hdb", "maple.ind" and "maple.lib" files, which comprise the package.

The strategy I gave earlier of converting to exp should work in general for any trig or hyperbolic trig functions.

https://www.mapleprimes.com/questions/239498-How-To-Derive-A-System-Of-Equations#answer306528

restart

with(PDEtools)

undeclare(prime)

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

_local(gamma)

ode := beta*U(xi)^2*c^2+(-alpha*c^2+1)*U(xi)+mu^2*c^2*(diff(diff(U(xi), xi), xi))

beta*U(xi)^2*c^2+(-alpha*c^2+1)*U(xi)+mu^2*c^2*(diff(diff(U(xi), xi), xi))

n := 2

2

F := U(xi) = sum(tanh(xi)^(i-1)*(B[i]*sech(xi)+A[i]*tanh(xi)), i = 1 .. n)+A[0]

U(xi) = B[1]*sech(xi)+A[1]*tanh(xi)+tanh(xi)*(B[2]*sech(xi)+A[2]*tanh(xi))+A[0]

K1 := eval(ode, F)

beta*(B[1]*sech(xi)+A[1]*tanh(xi)+tanh(xi)*(B[2]*sech(xi)+A[2]*tanh(xi))+A[0])^2*c^2+(-alpha*c^2+1)*(B[1]*sech(xi)+A[1]*tanh(xi)+tanh(xi)*(B[2]*sech(xi)+A[2]*tanh(xi))+A[0])+mu^2*c^2*(B[1]*sech(xi)*tanh(xi)^2-B[1]*sech(xi)*(1-tanh(xi)^2)-2*A[1]*tanh(xi)*(1-tanh(xi)^2)-2*tanh(xi)*(1-tanh(xi)^2)*(B[2]*sech(xi)+A[2]*tanh(xi))+2*(1-tanh(xi)^2)*(-B[2]*sech(xi)*tanh(xi)+A[2]*(1-tanh(xi)^2))+tanh(xi)*(B[2]*sech(xi)*tanh(xi)^2-B[2]*sech(xi)*(1-tanh(xi)^2)-2*A[2]*tanh(xi)*(1-tanh(xi)^2)))

Convert everything to exp, then write in terms of a variable eX = exp(xi)

K2 := collect(numer(normal(eval(convert(K1, exp), xi = ln(eX)))), exp)

eqns := {coeffs(K2, eX)}; nops(%); indets(eqns)

9

{alpha, beta, c, mu, A[0], A[1], A[2], B[1], B[2]}

solve(eqns, {A[0], A[1], A[2], B[1], B[2]})

{A[0] = 0, A[1] = 0, A[2] = 0, B[1] = 0, B[2] = 0}, {A[0] = (alpha*c^2-1)/(beta*c^2), A[1] = 0, A[2] = 0, B[1] = 0, B[2] = 0}

NULL

Download Find_params.mw

First 7 8 9 10 11 12 13 Last Page 9 of 82