dharr

Dr. David Harrington

8927 Reputation

22 Badges

21 years, 161 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 replies submitted by dharr

Nice challenge. It seemed to me that it should be possible to set up the geometry that @vv used, with point P at symbolic coordinates [x,y,z] inside a cube, construct the pyramids with each face and P as apex, find their volumes and use isolve to find integer solutions.
But making a pyramid with a symbolic vertex and finding its volume seems to be impossible in Maple as far as I can see.

 

@salim-barzani see the p.s. in my answer above. Then you have an error, but you can choose a subset of the variables to solve for. If you have something like {a=3,srqt(...)=sqrt(...)}, you can remove it with remove(has,...,sqrt).

@salim-barzani I put colons at all places where the message occurred. I may also have put it on lines where the output was many pages long, and inconvenient to scroll through.

The notation doesn't make much sense. I can't think of any interpretation that would bring B12 outside the exp. If you understand that, please give a few more examples of expected output.

Emding with ":" will remove this message, and does for the cases in your worksheet. (I didn't wait for the last solve to complete.)

limit.mw

@acer I had a copy in my downloads folder that I have uploaded. (I didn't remove it.)

@FZ The one with the ic works if you remove the hint.

@studentX369 Sorry, you're right; I always use the startup code region and assumed the regular code edit regions can be expanded to work the same way. I use the startup region to define all my procedures, and it has the features I was listing. (I'm using 2024).

For programming, the startup region uses enter for a new line (with automatic indenting) and has other nice features for programming.

Edit: my earlier recollection that the regular code edit regions can work the same way is incorrect.

@paulmcquad To get a line segment you can use the line command in the plottools package. If you also want the endpoints, you can add pointplot commands for them. You are, however, moving away from the simplifying features of Student:-Precalculus, which means you will have to learn many of the other commands if you want things in a very specific way. For example if you want labels for the points you will need the textplot command.

How-to-plot-distance-midpoint.mw

@nilswe 

restart

Paste as 2-D

`&||` := proc (R::(seq(algebraic))) options operator, arrow; `if`(nargs = 0, infinity, 1/(`+`(`~`[`/`](1, R)))) end procNULL

proc (R::(seq(algebraic))) options operator, arrow; `if`(nargs = 0, infinity, 1/(`+`(`~`[`/`](1, R)))) end proc

Doesn't work, even in 1-D

R1 &|| R2;
lprint(%);

R1*R2

R1*R2

Paste as 1-D

`&||`:= (R::seq(algebraic))-> `if`(nargs=0, infinity, 1/`+`(1/~R))

proc (R::(seq(algebraic))) options operator, arrow; `if`(nargs = 0, infinity, 1/(`+`(`~`[`/`](1, ` $`, R)))) end proc

Works in 1-D

R1 &|| R2

1/(1/R1+1/R2)

Doesn't work in 2-D

"R1&||R2;"

Error, mismatched or missing bracket/operator

"R1&||R2;"

Solution 1 - rename to &p

`&p`:= (R::seq(algebraic))-> `if`(nargs=0, infinity, 1/`+`(1/~R))

proc (R::(seq(algebraic))) options operator, arrow; `if`(nargs = 0, infinity, 1/(`+`(`~`[`/`](1, ` $`, R)))) end proc

`&p`(R1, R2)NULL

1/(1/R1+1/R2)

Solution 2 - if you want to use a symbol from the Operators palette, e.g., (ironically the not-parallel symbol, but some others will work)

`∦`:= (R::seq(algebraic))-> `if`(nargs=0, infinity, 1/`+`(1/~R))

proc (R::(seq(algebraic))) options operator, arrow; `if`(nargs = 0, infinity, 1/(`+`(`~`[`/`](1, ` $`, R)))) end proc

`∦`(R1, R2)

1/(1/R1+1/R2)

`†`:= (R::seq(algebraic))-> `if`(nargs=0, infinity, 1/`+`(1/~R))

proc (R::(seq(algebraic))) options operator, arrow; `if`(nargs = 0, infinity, 1/(`+`(`~`[`/`](1, ` $`, R)))) end proc

`†`(R1, R2)

1/(1/R1+1/R2)

NULL

Download resistor.mw

 

@salim-barzani My answer above is for the syntax error in your post above. There was no indication of any other questions you had. You separately posted about the xt problem, but that post is now gone, and @janhardo's answers are about that. @Kitonum gave an answer for that, that is more general and someone suggested algsubs.

Your problem in the replacing worksheet is that in eq6 you have x*t (as @janhardo pointed out), but in your eval you have xt=Y and not x*t=Y. But here if you are going to collect x and t and solve their coefficients you don't need this substitution at all. If you really want to substitute x*t here, you need to first substitute x^2 and t^2, then (now that there are no x^2 left) substitute x=Y/t and simplify (@Kitonum's solution IIRC). In general, eval (and subs) do not work well with expressions on the left-hand side (I managed to get away with it on your earlier examples). Algsubs only works for simple cases. In the general case where you want to do substitution in the arguments of trig function you may have more difficulty.

restart

L := ((2*k[1]*n[1]+2*k[2]*n[2])*(k[1]^2+k[2]^2)-(2*k[1]^2+2*k[2]^2)*(2*k[1]*n[1]+2*k[2]*n[2]))*x^2-(2*k[1]^2+2*k[2]^2)*(2*n[1]^2+2*n[2]^2)*x*t+((2*k[1]*n[1]+2*k[2]*n[2])*(n[1]^2+n[2]^2)-(2*k[1]*n[1]+2*k[2]*n[2])*(2*n[1]^2+2*n[2]^2))*t^2+(2*k[1]*n[1]+2*k[2]*n[2])*a[0]+3*(2*k[1]^2+2*k[2]^2)^2 = 0

((2*k[1]*n[1]+2*k[2]*n[2])*(k[1]^2+k[2]^2)-(2*k[1]^2+2*k[2]^2)*(2*k[1]*n[1]+2*k[2]*n[2]))*x^2-(2*k[1]^2+2*k[2]^2)*(2*n[1]^2+2*n[2]^2)*x*t+((2*k[1]*n[1]+2*k[2]*n[2])*(n[1]^2+n[2]^2)-(2*k[1]*n[1]+2*k[2]*n[2])*(2*n[1]^2+2*n[2]^2))*t^2+(2*k[1]*n[1]+2*k[2]*n[2])*a[0]+3*(2*k[1]^2+2*k[2]^2)^2 = 0

eq6 := eval(L, {t^2 = Z, x^2 = X}); indets(eq6)

((2*k[1]*n[1]+2*k[2]*n[2])*(k[1]^2+k[2]^2)-(2*k[1]^2+2*k[2]^2)*(2*k[1]*n[1]+2*k[2]*n[2]))*X-(2*k[1]^2+2*k[2]^2)*(2*n[1]^2+2*n[2]^2)*x*t+((2*k[1]*n[1]+2*k[2]*n[2])*(n[1]^2+n[2]^2)-(2*k[1]*n[1]+2*k[2]*n[2])*(2*n[1]^2+2*n[2]^2))*Z+(2*k[1]*n[1]+2*k[2]*n[2])*a[0]+3*(2*k[1]^2+2*k[2]^2)^2 = 0

{X, Z, t, x, a[0], k[1], k[2], n[1], n[2]}

eq7 := eval(eq6, x = Y/t); indets(eq7)

((2*k[1]*n[1]+2*k[2]*n[2])*(k[1]^2+k[2]^2)-(2*k[1]^2+2*k[2]^2)*(2*k[1]*n[1]+2*k[2]*n[2]))*X-(2*k[1]^2+2*k[2]^2)*(2*n[1]^2+2*n[2]^2)*Y+((2*k[1]*n[1]+2*k[2]*n[2])*(n[1]^2+n[2]^2)-(2*k[1]*n[1]+2*k[2]*n[2])*(2*n[1]^2+2*n[2]^2))*Z+(2*k[1]*n[1]+2*k[2]*n[2])*a[0]+3*(2*k[1]^2+2*k[2]^2)^2 = 0

{X, Y, Z, a[0], k[1], k[2], n[1], n[2]}

eq7 := algsubs(x*t = Y, eq6); indets(eq7)

-2*X*k[1]^3*n[1]-2*X*k[1]^2*k[2]*n[2]-2*X*k[1]*k[2]^2*n[1]-2*X*k[2]^3*n[2]-4*Y*k[1]^2*n[1]^2-4*Y*k[1]^2*n[2]^2-4*Y*k[2]^2*n[1]^2-4*Y*k[2]^2*n[2]^2-2*Z*k[1]*n[1]^3-2*Z*k[1]*n[1]*n[2]^2-2*Z*k[2]*n[1]^2*n[2]-2*Z*k[2]*n[2]^3+12*k[1]^4+24*k[1]^2*k[2]^2+12*k[2]^4+2*a[0]*k[1]*n[1]+2*a[0]*k[2]*n[2] = 0

{X, Y, Z, a[0], k[1], k[2], n[1], n[2]}

 

NULL

Download replacing.mw

@salim-barzani Many commands, such as simplify, work with equations, but some do not (like coeffs here). For this reason, I usually do not have the =0 at the end of everything; then I don't get stuck like this.  Almost all Maple commands, such as solve, dsolve etc interpret an expression without =0 as though the =0 was present. Learn from this.

N-soliton1.mw

@salim-barzani Well, that is what the solve(identity,...) would have given for that set of equations and unknowns if it had worked, so it is the direct answer to your question. It also has nothing to do with the fact that there are two parameters x and t. If it doesn't work for you then you should reformulate the problem into the correct form first.

@janhardo Yikes! DEtools seems to be an old-style table-based package; I thought they had all been upgraded. The workaround would be to use DEtools[DEplot] on the two occasions you need DEtools.

First 22 23 24 25 26 27 28 Last Page 24 of 96