tomleslie

13876 Reputation

20 Badges

15 years, 169 days

MaplePrimes Activity


These are replies submitted by tomleslie

@capacitator 

Looks like you don't have the directSearch package installed. You can download it from

http://www.maplesoft.com/applications/view.aspx?SID=101333

@Carl Love 

I think one would have to be partially psychic to get from the OP's definition to the formula in Wikipedia - and my crystal ball wasn't working too well yesterday

Earlier today you wanted to define some sort of "binomial" function, but were unable to adequately define this function.

It appears now that you want to redefine Catalan numbers - why???

If you check wikipedia you will see that the Catalan number Cn is defined as

1/(n+1)*binomial(2*n,n)

which you can compute by defining the simple Maple function

Cn:= x->1/(x+1)*binomial(2*x, x);

and the first 20-odd Catalan numbers can then be calculated using

seq( Cn(j), j=0..20);

Compare the output of the above with the Wikipedia entry.

Why are you posting a nonsensical definition of Catalan numbers?

Does this has anything to do with your ludicrous definition of binomial coefficients?

Or do you like to redefine simple well-known functions in nonsensical ways?

@law47 

Starting from your original PDE, on what basis do you draw the assumption/conclusion that

_y1^2: L(x,y)_yy = 0

This would seem to depend on a rather strange orthogonality condition which you have not chosen to dislcose?!

If you are just trying to group terms separately, you can use

collect(ODE, [y(x), _y1(x)]);

but you cannot "split" thi equation in any meaningful way - apart from anything else, you have at least one term which depends on the product y(x)*_y1(x). How do you plan on "splitting" this?

The binomial coefficient is returned using

binomial(n,k)

If you are attempting to define some new function of two integers, then you are going to have to specify this function more clearly, because the definition you supply doesn't make much sense

Generating the relevant data from the pdes is pretty trivial, but your final requirement

Calculate the error norm ||E||_h = sqrt(sum_{j=0}^{1/h} h* |u(j*h,tval)-v(j*h,tval)|^2)

doesn't make much sense syntactically or otherwise. So before I do any more wotk can you confirm that what you actually want is

||E||_h = add(abs(u(j*h,tval)-v(j*h,tval))^2, j=0..1/h);

If this expression is not correct then kindly supply one which makes sense (syntactically)

I have just tried your example

with(Optimization):
LPSolve(2*x+5*y, {3*x-y=1, x-y<=5}, assume={nonnegative, integer});

using Maple2015.1 on  Win7, 64-bit.

It generates the same answer  as the help page (in negligible time)

Have you tried a restart immediately prior to the example?

I have "accidentally" come across what I will loosely call "prefix" notation for basic arithmetic operators in Maple: for example, using 1-D Math input

`*`(a,b);

appears to be parsed identically to a*b.

I did once write a micky-mouse RPN parser in Maple (don't ask why), and I have to admit that the existence of this prefix variant came in quite useful. However as a general rule I cannot envisage anyone ever using the prefix versions with 1-D input

However, when answering problems on this site posed in 2-D math, I often convert these to 1-D input and occasionally see the prefix arithmetic operations. Normally I don't bother about this too much. However, having read your question I decided to "play" with 2-D math input a bit.

No matter how I entered expressions, keyboard, palettes, use of implied multiplication, whatever, I just could not come up with an expression which, when comverted to 1-D input, had any prefix arithmetic operators in it - they were always infix, although sometimes with (what I would consider to be) superfluous parentheses

Like I said - I am sure that I have seen prefix arithmetic operators when I convert other people's worksheets to 1-D math - but what exactly are they entering in 2D in order for this to happen, cos I can't do it.

Are they doing it "intentionally" or is it "accidental"

  1. Find/Replace will work on 1D math input, but not on Maple output
  2. Find/Replace won't work on 2D math input (or the corresponding output)
  3. Hence |Find/replace is never the solution - because OP wnats to look at output

Assuming that the Maple output in question is  (more or less) a sum of products (which I would expect for a determinant), then something like

seq( `if`( k[1]="-", parse(k), NULL),
      k in seq( convert(j, string), j in op(expr))
   );

*ought* to work, for a given 'expr'

Depending on the form of the 'expr' to be tested, it *may* be necessary to play other tricks such as mapping a termwise 'expand' across the expression. Since the OP does not not provide an example of the expression to be tested, it is difficult to be more specific

If I look at eqn1 in 1D math, I see

equ1 := -l*cos(xi)^2*(1-cos(beta__f))/(alpha^2 . sin(sigma))-lambda__2*w*(v^2 . sin(sigma))/(g*l*cos(xi)^2) = 0

what mathematical operation is being performed by the '.' As stated on the help page for '.' it can be used either as non-commutative multiplication, or a scalar product - neither of these seems particularly appropriate in this expression. Which (if either) of these operations did you intend???

The same 'operator' occurs in equ2

equ2 := -l*cos(xi)^2*(1-cos(beta[f]))/(alpha*sin(sigma)*tan(sigma))+(l . (cos(xi)^2))*z__0*sin(beta__f)/(alpha*sin(sigma)*(2*l*cos(sigma)^2))-lambda__1*`#mi("L")`*`#mi("sin",fontstyle = "normal")`(sigma)*cos(xi)+lambda__2*L*cos(sigma)*cos(xi)-lambda__2*w*alpha*v^2*sin(sigma)/(g*l*tan(sigma)*cos(xi)^2)

although even more interesting in equ2 is that you use the quantities beta[f] and beta__f, which I am sure you realise are two completely different things - which you intended - or maybe not

If you must use 2D math input then please do so correctly - debugging this input format is particularly tedious for those of us who never use it

If I correct all of the 2-D math input syntax errors (and I admit that there are places where I am guessing), commentig out ot all of your original code, then the attached worksheet, with all execution groups in 1D math, actually comes up with a solution!!!!!

BrysonCorr.mw

See the attached

plData.mw

Well I still have some  concerns, some minor (and possibly irrelevant) and at least one significant. In ascending order of concern, these are

  1. You have defined two quantities which appear as Eb and Ib, except that these are defined differently. What appears in Maple output as Eb, is actually defined as E[b], ie the b-th element of an indexable data structure (list, set, array, vector, whatever). However what appears in Maple output as Ib is defined as I__b, which you can think of as mere typesetting: - you just want a variable which happens to have a subscript in its name - with no implication that this is some part of a more complex data structure. I rather doubt that this distinction is causing any problems, but when bug-hunting, it is always a good idea to fix even the most trivial stuff (just in case)
  2. There are a few places where you have superfluous parentheses, eg the definition of 'f' as omega*(t)/2, which Maple will interpret as omega*t/2. I am assuming that you never intended to write omega(t)/2 anywhere, which would be the function 'omega' with the argument 't'. Detecting potential ambiguities such as this, is more difficult (I find) when using 2-D math input. I suggest that you check carefully for the distinction between function definitions and simple products, and delete superfluous parentheses - it makes things a lot easier to debug. I don't think that this is an issue in your worksheet and I am pretty sure that in all cases in your example, Maple will be interpreting these as simple products - but is that what you meant?
  3. Do you have any reason to believe that this PDE has an analytic solution??? Is it some kind of textbook, student, example: or is it a real world problem? Your defualt mindset should be that "textbook" examples of PDEs "always" have an analytic solution, and "real world" PDEs "never" do!  This staement isn't 100% accurate - but it is a sound "starting point" for what to expect. The reason for asking is that you have a PDE in two variables, 4th-order in the first variable (xi) and 2nd-order in the second variable (theta). It is a long time since I studied PDEs in a formal course, but I'm pretty sure this means you will need  six boundary conditions to get a complete solution - you only have 5. If the PDE has an analytic solution this may(?) not be too bad - it just means that any analytic solution will contain a single arbitrary constant
  4. However if this is some kind of real-world problem, with no analytic solution and one has to try the numeric route, then six boundary conditions will be mandatory. There is  a further danger. The five bcs which you list are identically zero: adding a sixth which is identically zero will mean that the function V(xi, theta)=0, will almost certainly be a valid solution - and you probably don't want that! So consider number of bcs and their values very carefully

If I enter each of these equations in Maple and then use the dsolve() command, I get solutions for all 6 equations. I suggest you try it - it took less than 5 minutes for all 6 - I'm a slow typist!

  1. There is a simple syntax error in the term Eb*Ib which is not "obvious" becuase of your choice to use 2D math input (always a good choice for generating/hiding simple syntax errors)
  2. Allowing for the above you end up with one differential equation in terms of two independent functions V() and phi(). This will never be solvable
  3. Now phi() is defined in terms of "simple" quantities at the start of the worksheet but such definitions are all commented out - so I have no idea whether phi() really is an indeterminate function , or should be defined in terms of simpler quantities: please decide.
First 168 169 170 171 172 173 174 Last Page 170 of 207