tomleslie

13876 Reputation

20 Badges

15 years, 172 days

MaplePrimes Activity


These are replies submitted by tomleslie

Bare Matlab with no toolboxes, can solve pdes. Check out the commands pdepe and pdeval

I know their functionality is limited (otherwise how would they sell a pde toolbox!), but you never know, you might get lucky

I still think that solving the problem in one product or the other is a better option than trying to do half in one and then transferring to the other

Short answer is no - there is no way to read a .mpl file and have it "distributed" across multiple execution groups

I think the fundamental issue here is a "usage" model. I use .mpl files quite a lot. However I use these strictly to define one (or more) procedures. They never contain any other executable code. This means that I can construct a.mpl file in a serious coding editor, with assorted feaures like automatic indentation, parenthesis highlighting etc etc, all of which are "better"(?) than constructing the same thing within Maple. I then need a single Maple read() statement to read/define maybe a dozen procedures with a few hundred lines of code. This cleans up longer Maple worksheets a lot: The consequent worksheet is generally a sequence of procedure calls with maybe the odd line of code in-between.

Note that this is just a working method I find convenient. Others will have other favoured working methods. The one think I would never do is put actuak executable code in an mpl file -way too difficult to debug.

I can think of no reason to place Maple code in a .txt file, but again this may be because it is something I never do. I simply cannot imagine why I would ever want to!

@Carl Love 

At least I admitted that my oriiginal was ugly.

I get the the idea of of rebuilding the sum rather tha substituting, and if I had only remembered that some types respond meaningfully to op(0....) - then maybe . '0' arguments for op() always get me!.

Thus the first argument handles the summand, and the second argument handles the range spec, but at the risk of appearing a dumbass I don't get the third argument ( ie 'op(3.., S) ): so far as I am aware s(S)ums only have two argument/operands - summand and range spec: so what is this third argument doing? It doesn't error, so presumably a third argument/operand for sum() is acceptable. I can see that you are only reproducing the third argument of the original in the index-shfited sum. but what is this third argument

I've tried deleting op(3.., S) from your procedure, and seem to get the same answers on my test cases whether it exists or not - educate me!

  1. You have three pde's, but only one independent variable, ie y(a,b). This is analogous to having three simple algebraic simultaneous equations in one variable. In the latter case, you would not normally solve the three equations "simultaneously", even if they were consistent. You would solve them one at time. Similar argument argument applies to solving three pde's in one dependent variable - you should be solving them one at a time (and maybe hope that they are consistent!)
  2. Why does x=1 occur as a "boundary" condition. A boundary condition  can only specify the values of the dependent variables y(a,b) (or its derivatives) at fixed values of one of the independent variables a, b. So y(0,a)=1 would be a boundary condition, but x=1 is meaningless as a BC. Do you mean that you want to substitute x=1 into your system?
  3. Actually don't substitute x=1 in your equations, beecause this will lead to multiple instances of the square root of a complex number, which (as far as I am aware) none of the methods returned by pdsolve will be able to handle

Timeline on this one has got a little convoluted

The original post used a printf() statement. My original response stands, that with printf() statements, the use of blank filler strings should never be necessary

I missed the fact that in the repost the OP reverted to print() statements :-(

My only excuse is that I'm pretty sure that my original response fulfilled the OP's original request, so I didn' read the repost too carefully

When I run the code you have posted, it fails with an error message on the first line of the code you have added: I suggest you

  1. Read the error message
  2. Check for the position of the flashing cursor - which will tell you where the error is
  3. Fix the error

If you do not understand enough about Maple syntax to write one line of code without producing a trivial error , then I suggest that you type 'Tutorial' in the Maple help search box and spend some time on this.

Once you have worked out how to fix this error, you will find that there is another error on the second line of the code you have written: I'm curious, do you actually enjoy writing syntactically incorrect code? Or maybe you think I have nothing better to do than fix your incompetence?

You posted the question

"The following code displays values of the subscripted variables slf[], a positive integer, and a string variable filler[] which is just a set of spaces depending on how big the corresponding value of slf[] s.  This is to make the printout lined up nicely.  

printf("%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d\n", filler[1],slf[1],filler[2],slf[2],filler[3],slf[3],filler[4],slf[4],filler[5],slf[5],filler[6],slf[6],filler[7],slf[7],filler[8],slf[8],filler[9],slf[9],filler[10],slf[10]);

   This works fine,but thought there might be a better way."

I posted a "better" way.

I suggest you copy/paste my original code into Maple and watch how it aligns the "values of the subscripted variables slf[], a positive integer" - then specify exactly what I got wrong

You seem to persist in your belieg that blank filler strings are somehow necessary/important. I have news for you - any use of blank filler strings in formatted output only demonstrates use incompetence.

I started using format codes for printf statements in 1970 (ie 46 years ago!). These format codes were carefully designed so that no-one would ever, ever have to use blank filler strings.

So for the last 46 years (at least), no-one competent has used blank filler strings.

I suggest that you sit down quietly somewhere and read about the use of format codes in printf statements. This is invaluable knowledge because they don't really vary between programming languages - everything from Maple to C#. matlab to C++, perl to python, whatever - they all use the same format codes with only very minor differences. Learn them once and you will be able to apply in pretty much any programming language under the sun.

 

I agree with vv: I only checked this in worksheet mode, with 1D and 2D math: with 1D math it works, with 2D math it doesn't. I've just cjecked doument mode (which I never use - even scarier than 2D ,math option), conclusions as follows

worksheet mode, 1D input:- works

worksheet mode, 2D input: doesn't work

document mode, 1D input: doesn't work

document mode, 2D input: doesn't work

Good example for sticking with 1D input worksheet mode

@Maple_User 

The question is

"we are told to take the differential equation " dy/dx = sin (x - y) " and substitute in y = ax+b, then determine which coeffecients of a and b should be in order to obtain a solution."

So you do not have to "solve", the differential equation. You are given the solution y = ax+b and asked what are the values of 'a' and 'b' which make y=ax+b a valid solution

This is pretty trivial to do, and the answer is a=1 and b=-π/2.

The attached shows one (of many) ways to do this. It is very step by step to assist explanation: I could nake it a lot shorter if I wanted to (but it would be more difficult to follow)

solveEQ.mw

You state that

"Unfortunately, our only resource for the class regarding Maple is the Differential Equations textbook"

I recommend that fire up the Maple help, and type tutorial in the search box. Then work your way through the MaplePortal Tutorials 1-10

@Bart 

I'm running Maple2015.2. I only see this problem when I use 2D input. With 1D input, it works as expected.

Your question is meaningless. The statement

Max: w=x1/2 y1/4

is mathematical nonsense. Now the expression for w might be something like w=x^(1/2)+y^(1/4), or it might be w=x^(1/2)*y^(1/4) or any of dozen other combinations I can think of. And then what - you wnat to maximise this expression

In most of the combinations I can think of, the expression would be "maximised" by setting y=infinity. The constraint you post, ie "Subject to: K=x+4. K is a constant." would be irrelevant if y is infinite

If you seriously expect an answer on this forum, you will have to specify your problem much more precisely

I suggest you read the help page for GroupTheory[AreIsomorphic], which will check whether two groups are isomorphic, and (supplied with the correct options), will return the mapping for the isomorphism. I've never tried this before, so I have no idea whether the calculated isomorphism will be invertible.

My immediate thought is that since an isomorphism is 1->1, then it must be invertible: I probably need an example of two isomorphic groups so that I can

  1. examine the structure of the  mapping
  2. figure out how to invert it
  1. Formulate your question in a way which I can understand what you want to achieve. This may involve determining which are your independent variables, which are your dependent variables and which dependent variables you need to determine in terms of the independent varables. Think clearly and carefully
  2. Keep reading my originally posted solution until you understand it. Bear in mind the following:
    1. There are four "lines" in the picture you posted.
    2. The second "line" is pointless and irrelevant. It is used by nothing, nowhere. Why does it even exist?
    3. I determined the values of b and delta which would ensure that lines 1 and 3 are satisfied
    4. I demonstrated that the these values of b an delta also satisfy the conditions specified in line 4 of your picture
  3. Now precisely what did I get wrong?

@vv 

In my original response to this question (which I had completely forgotten), I interpreted the OP's request as follows.

Given two polynomials p1(x) and p2(x), compute the polynomial p1( p2(x) ) - think fairly conventional composition of functions.

I could have used Maple's @ operator, as in (f@g)(x), but as it happens, I didn't. I just defined two functions f() and g() and computed f(g(x))

I had no feedback at the time so assumed the OP was happy

Like you I'm not too sure what the latest couple of requests mean!!!

@ggill 

I forgot that becuase I had a "retail" DVD for Office, it has both 64-bit and 32-bit versions. Don't now remember why I originally installed the 32-bit versions - it was a while ago.

However uninstalling 32-bit Office, and installing 64-bit Office fixed the problem. Maple addin now functional in Excel

First 161 162 163 164 165 166 167 Last Page 163 of 207