Dr. David Harrington

5973 Reputation

21 Badges

19 years, 300 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 professor of chemistry at the University of Victoria, BC, Canada, where 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

@nm To make a bug report, just use the Mapleprimes "more" tab and choose "submit software change request"

@saher There is a PDE in your worksheet that you solve with pdsolve. So if that's not what you want you will need to be more specific about what exactly you want to do.

You used invElziki when it was defined as invEl, but I really don't understand what you want to plot. Your Elzikisol is a function of x that returns something with y in it. So you need to specify y before you can do a 2D plot. Not clear why you are plotting this twice. Perhaps you want a 3D plot?


@Amir Saman Mir Not sure what happened; I get the right answer.


invEqs := [a[3]*cos(theta[1]+theta[2]+theta[3])+a[2]*cos(theta[1]+theta[2])+a[1]*cos(theta[1]) = px, a[3]*sin(theta[1]+theta[2]+theta[3])+a[2]*sin(theta[1]+theta[2])+a[1]*sin(theta[1]) = py, theta[1]+theta[2]+theta[3] = phi]

[a[3]*cos(theta[1]+theta[2]+theta[3])+a[2]*cos(theta[1]+theta[2])+a[1]*cos(theta[1]) = px, a[3]*sin(theta[1]+theta[2]+theta[3])+a[2]*sin(theta[1]+theta[2])+a[1]*sin(theta[1]) = py, theta[1]+theta[2]+theta[3] = phi]

q := [solve(invEqs, {theta[1], theta[2], theta[3]}, explicit)]

Two solutions - try each below - both give the same answer for cos(theta[2])



We want cos(theta[2])

c := simplify(eval(cos(theta[2]), q[1]))


In terms of qx and qy

simplify(eval(c, {px = qx+a[3]*cos(phi), py = qy+a[3]*sin(phi)}))




Download theta.mw

@tarik_mohamadi NullSpace(R1) leads to nonzero entries for only entry 5 and 7, showing that columns 5 and 7 are multiples of each other.


@lemelinm Sorry, I don't really understand what you are asking. You wanted Maple to do it automatically, and it does. You must have i<>j to fit a polynomial - if you had two y values for the same x value then it is not a function, and it cannot be a polynomial. If you try the i=j case, with two x values the same, then Maple correctly produces an error.

Interpolation of higher order polynomials will not be unique and they will tend to oscillate, so that is usually not useful.

You can construct your l_i(xi) by, for example

n:=4:i:=3:mul((xi-x[j])/(x[i]-x[j]), j in {$1..n} minus {i})


@ogunmiloro If you want values every 0.1 you can just set up a loop:


@MPM2357 This is great - the bug has been fixed in 2021.0. I was using 2017. Note the general solution you got has sin(Pi*n*(r-1))=sin(Pi*n*r), but Maple 2017 got sin(2*Pi*n*r), I should have looked more carefully at your output before I ran the worksheet. So your general solution was the sum over n of sol4 (eq8), so you could start from that point directly. 

@Pepini Even without the IC there is no general solution. I think abs is a problem here. Perhaps there are some manipulations that could be done, like separating into magnitude and phase, but you probably need to know where you are headed.

The line assigning to pe is incomplete - it ends in ^

@J4James So there is no explicit solution for this. So the best you can do is to use unapply to make a function (procedure) out of it, and then use it for numerical work. The plot shows though, that the equation has multiple solutions and it is jumping from one to another, though perhaps it doesn't for the range of H you want.

In principle, you can use evalindets to alter the RootOf's to the form of RootOf which supplies a range to force the right root, but you need to know what its approximate value is. Or probably easier to use fsolve earlier, forcing the right roots by specifying ranges.


@J4James Hard to diagnose without a worksheet.

@J4James The RootOf suffices for numerical work. If you instead want an analytical solution, you might be able to get one using the "explicit" option in solve. Normally, if you want an analytical (symbolic) solution, you would do the manipulatiions and solving without putting in floating point numerical values, and then put these in at the end.

@AmirHosein Sadeghimanesh  You asked for commands within Maple, and these come the closest to what you asked for. I mentioned them in case you wren't aware of them. So within Maple, I think there are no such features. There may be outside code editors - I don't know much about VSCode. Notepad++ has a Maple plugin, but I haven't used it. There may be others; perhaps others can provide suggestions.

@vv Thanks. As you see, I tried solve but assumed that it worked in the complex domain, as is generally true for Maple. Now I check the help for solve,ineq I see the restriction is stated.


is(p1,nonnoegative) works in the complex domain

solve(p1>=0) works in the real domain (and gives answers that are incorrect in the complex domain)

solve(p1=0) works in the complex domain.

Very confusing, and close to a bug IMO. Perhaps solve(p1>=0) should give a warning.

While I expect that in math, p>0 implies p is real, I don't expect that x^2<0 precludes x=I.

First 38 39 40 41 42 43 44 Last Page 40 of 62