dharr

Dr. David Harrington

8355 Reputation

22 Badges

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

@GFY You can solve it by narrowing the ranges, with guidance of a plot. You could modify the equations so a__3=0,c__3=0 is not a solution by factoring and dividing through by power(s) of a__3 and c__3.

question11.mw

@GFY That was unexpected for me. Solve is really for symbolic solutions, and you have floats in your equations. I always formulate equations symbolically, and try solve. Then one can substitute values for the parameters, e.g., params:= {a=3.1, b=2.1 etc}, then eval(eqn, params);

@Aixleft math Typically I specify as many variables as equations, but if there is a solution with more, Maple can often find it.

@mz6687 You want to make assumptions on all variables that you want to be real:
simplify(conjugate(q)) assuming a::real, t::real etc. (or make all assumptions at the beginning of your worksheet)


evalc automatically assumes all variables are real, so another approach would be to separate lambda1 into real and imaginary parts and then use evalc, which is probably the approach I would take.

@nm Interesting. Note A.5 gives 5*A but 5.A gives "Error, missing operator or `;`", and A.B gives A.B (the matrix multiplication symbol).

@mz6687 OK, but without further information the question remains as to why they should both give zero for the same set of parameters - that seems to be your expectation and question.
 PS. I edited my above comment since I forgot evalc will also assume lambda1 real. Probably using conjugate with assumptions on variables is the way to go. 

Just a couple of comments, based on what I think you want to do. You manually do a complex conjugate by substituting I=-I, lambda1 = conjugate(lambda1), etc, but simplify(qb-conjugate(q)) does not give 0. Edit: removed incorrect solution to this.

You have two equations

eq1 := -2*q*diff(qb,t) - 2*(diff(q,t))*qb + diff(v,x) =0;
eq2 := 2*I*diff(q, x,t) + I*q*v + I*v*q + 2*diff(q,t)=0;

and substituting in some parameters you find eq2 gives 0=0 but eq1 does not. But they look very different to me. Are they supposed to be complex conjugates of each other?

You have many subscripted Energy variables so I can't really understand what you want to do, and some change of variables is mentioned but without being specific. It seems strange to differentiate and then integrate almost the same thing. It would be a lot easier to understand if you have variables instead of numbers (see my example below).

Perhaps you could just solve a differential equation. If you just want plots, something like the following implicitly dies a change of variables from t to E. Or you could use PDEtools:-dchange to get Maple to do the change of variables on the original ode. Perhaps the following does something that can be adapted to your situation.

Download DAE.mw

@mary120 You see at the end of the worksheet that the numerator has M^6 + const*M^4+const*M^2+const and the denominator has M^2*(M^6 +const*M^4+const*M^2+const)

@Johan159 Sorry, I misunterstood what you are trying to do, and I agree you want to solve for y_. Look at the implicitplot here - there are two branches - which do you want (or both)?.

The problem is too hard with the double piecewise, since for a given y, the answer for y_ can be in any of three regions, so there are 9 possibilities overall that Maple needs to consider. I suggest you have separate equations for each y region,  then solve for y_ (perhaps still piecewise, but better not). Even then, there might not be an analytical solution from solve and you then have to use fsolve (and make a function that takes uses fsolve to output y_ given y.. I suugest as a starting point you look closely at the implicitplot for one of the regions you are interested in - choose a region for y that has y_ in only one region and try to solve that first (no piecewise). The you will know whether you can use solve. 

I would say in general solutions with piecewise are difficult to solve, but easier with fsolve.

M_V_as_function_of_hight_cc_temporary_dharr.mw

@Aixleft math A quick way is 

pcube := draw(poly(color = black, cutout = 0.98));

though cutouts don't really leave lines (try a smaller number to see).

Alternatively you could just find the edges and plot them as lines. Strangely, geom3d doesn't have a way to find edges directly; you have to do it via faces. See attached.

Download cube.mw

@Carl Love That's an interesting assumption about how is works. Since evalb doesn't want to work with sqrt(3) and other algebraic numbers, and is will, I assumed that is is purely symbolic, and evaluates is(sqrt(3)<3)by squaring both sides or similar, so floats are never required (and hence takes much longer). I like to think there is never any doubt when Maple works symbolically, and it is probably possible to always find an example where float numerics fail.

If I change the 2D math to 1D math and execute with the ! icon it works.

@Hullzie16 OK, solve,identity seems to work only up to about -5, and as you say doesn't take into account the fact that you can solve them sequentially. So your method seems OK to me; a slight improvement might be

for i to 10 do b[i]:=factor(solve(coeff(E2-Q/r,r,-i),b[i])) end do;

 

First 19 20 21 22 23 24 25 Last Page 21 of 87