tomleslie

13876 Reputation

20 Badges

15 years, 163 days

MaplePrimes Activity


These are replies submitted by tomleslie

@KimonoMyHouse 

I don't think you are getting it.

If you want help from people on this site, then you upload all necessary information to this site

Instructions for doing so have been previously given in this thread

@RAfossey 

Don't retype anything - the frequency of typos in your postings shows that you cannot be relied on to read/type the instructions you have been given.

Use cut-and-paste to insert the following five commands into your worksheet

restart;
yn:= invztrans(z/(z-2)*5*z/(5-z)^2, z, n); # do the inverse z-transform
qn:= sum(2^(n-k)*k*5^k, k=0..n); # do the sum
simplify(yn/qn); # simplify the ratio of the two results obtained above
simplify(yn-qn); # alternative equality test

@patient 

Essentially the same result as Carl. Following worksheet "works" but odes are exhibiting singularities

odeplot2.mw

Have had a quick look at your original system of equations and can't see an *obvious* reason for the singularities. Very loosely speaking, real-world, "physical" systems rarely exhibit this kind of behaviour (it can happen, but not often!) so would respectfully suggest that if this is a representation of a "real-world" phenomenon then check the original equations for typos - very carefully. If this is some kind of abstract mathematical problem, then much more likely for singularities to occur: still worth checking the original equations for typos, but assuming these are correct, then very difficult to work around singularities in a numeric solution.

As the last line of the above worksheet shows I tried for an analytic solution to see if this would help work around the singularities - but no luck

So much easier to debug if you supplied dsys:

For example if you have three values of a parameter in a list, params[-1,-0.5,-0.1], then

sol:=[seq(dsolve(eval(dsys, t=params[j]),numeric), j=1..3)]

CAN'T VERIFY WITHOUR DSYS!!

will give a list of solutions which might work if the the parameter name within dsys happens to be t. Then depending on the names of the variables and functions you are trying to solve for (again so much easier if you just supplied dsys), you ought to be able to get three plots with

pls:={ seq( odeplotodeplot(sol[j],[x,f(x)],x=-1..0,j=1..3)};

CAN'T BE VERIFIED WITHOUT DSYS


and then display them with

display((pls});

which again CAN'T BE VERIFIED WITHOUT DSYS

but almost impossible to verify the above without access to dsys. With access to dsys, this problem ought to be trivial

Consider uploading the worksheet you have so far (with dsys) using the big green upload arrow, right hand end of the second row of toolbar icons

 

Difficult to work on this without the data you are trying to plot. A maple worksheet together with the datefiles you are trying to plot would be useful. Recommendations are

  1. upload the worksheet which succeeds on your "small" example and fails the "large" one - upload is big green arrow at the right-hand end of the second row of toolbar icons
  2. If the plot data is not generated within the worksheet, then upload the files containing the original data - assuming that these are csv xls - whatever. Just something reasonably standard that we can read
  3. Just make sure you upload code/data. not "pictures" of code/data

@trace 

Since your latest worksheet still show no signs of applying the dAlembertian() command, I have no idea wha your probem is. The only thing I can suggest is the same as my original post - try the Physics[dAlembertian] help page - or am I missing something????

If my interpretations are correct, then there are so many syntax errors, that it i difficult to determine what you originally wanted.

For example, you regularly use psi[j](X), which maple will interpret as a vector psi[j] in the current coordinate system. However in the final three differentiation expressions you are differentiating expressions containing vectors psi[j], psi[k] wrt a vector psi[i], so no surprise that the answers always come up as zero

An alternative interpretation is that when you are using psi[j](X), you mean the j-th entry of the vector psi(X). So that, in some sense you are trying to set up the Lagrangian on an element-by-element basis. However, this is not how maple will interpret the notation. The j-th entry of the vector psi(X) would be psi(x)[j].

Consider your final expression for L3 which mixes both notations:

conjugate(psi(X)[j]) is a scalar which is the conjugate of the j-th element of the vector psi(X), whereas psi[j](X) is a vector which has the label 'j' attached. So this expression is a scalar multiplying a vector, except that you have used the operator '.' for matrix multiplication, which suggests you think both are matrices

A similar problem occurs in your expression for L1 and L2, Dgamma[nu][j,k] is the j,k-th entry of the Dirac gamma matrix. In your expression for L1 it then correctly surrounded by '*' scalar multiplication signs, but in your expression for L2 it is surrounded by '.' matrix multiplication signs - so do you think it is a scalar or a matrix???

Note that if you are trying to set up the problem elementwise (which I suppose is possible if unusual), then your final three differntiation are till with respect to a vector psi(X), carrying the label 'i'. Since this vector occurs nowhere in your "elementwise" expressions, then Maple will return 0

Another problem in your first expression uses d_nu, which I'm betting you think is the indexed differential operator - except that in you expression it has no argument(s), I rather suspect maple will be interpreting this as a scalar variable which happens to be called d_nu.

Overall, it is too difficult to determine precisely what you are trying to achieve - are you computing the Lagrangian for vectors, or are you trying to do it on some kind of element-by-element basis

Having said all of the above, my best guess as to what you were trying to achieve is shown in the attached

QED-2.mw

However the original contained so many errors, that my interpretation may be completely wrong, and even if I am correct, the chances that I managed to fix all the errors are pretty small ;-(

 

 

Expression given by OP are too ambiguous for me to work out the intent. Recommend use of 1-D math input. having said that, the following ought to be useful

part (a): help page - read ?invztrans

part (b):  help-page - probably need to read ?sum

part 1(a) : help page - should be covered by reading ?rsolve

part 1(b): should be trivial given 1(a)

part 1(c): should be trivial given 1(b)

try the Physics[dAlembertian] help page - or am I missing something????

@bq7327645 

Works in the standard worksheet environment of Maple 2015 running on Win7, 64-bit

The OP's first post was titled Euler-Lagrange equations, so I assumed he wanted to solve the Euler-Lagrange eqution for the function he posted. I might have been wrong in this assumption  since the "code" which he posted suggests that he imay simply want to differentiate a function wrt a function (which you have assumed). Obviously processes are not the same thing. Solving the Euler-Lagrange equation means solving an equation of the form

             diff(F(x,y,y'), y) - diff( diff(F(x,y,y'), y'), x)=0,  for y, or y'

             whereas the Physics[diff] computes diff(F, y').

I struggle to see why these should ever give the same answer, although obviously for the OP's value of F - they did!

It does not surprise me at all that the counter-example you quote gives different answers, for two reasons:

Firstly, as noted above, solving the Euler-Lagrange equation and differentiating wrt to a function are two distinct concepts - I would expect them to provide different answers.

Secondly you have chose to use F(x,y,y',y''), and solving the Euler-lagrange equation for functions involving y'' gets even more complicated. The VariationalCalculus[EulerLagrange] help page does make it clear that the command should only be used for functions of the form F(x,y,y'), so I'm mildly surprised that it produced anything at all for the example you used.  To be fair the  help page does outline a method, by which the Euler-Lagrange equation for functions such as F(x,y,y',y'') can be achieved, although I admit  haven't tried it

You are correct that there was a typo in my original response

 

@maple2015 

You use

" Vriational Calculus and solve Integration analytically by using Euler-Lagrange equation command:"

so at this stage you have an analytic solution, for which I assume you can compute numeric values??

So why would you want to replace the exact analytic solution with a (less accurate) one using any kind of numeric methods (spectral or otherwise). I suggest you post a worksheet showing your calculation so far with a detailed description of which part is failing

@itsme 

You can assume that when I refer an OP to a help page, then I have actually read the help page, so providing me with a link to it is pointless.

The aforementioned help page (with a change of variables) tells me that, that the OP's original problem is solved with

with(VariationalCalculus);
F:=D(y)(x)^2-y(x)^2+2*y*x^2;
convert(EulerLagrange(F,x,D(y)(x)),diff);

Have I missed something??

I finally got around to running your original data through a text editor, and after fixing a few typos (mainly "." where you needed ","), I persuaded Maple to accept the data, then did the calculation I originally outlined. And I got exactly the same answer that Kitonum did - see the attached

oddMatMul.mw

which I guess shows two things

  1. Kitonum is one smart guy
  2. There's always more than one way to do it

Still, your problem is definitely solved

Rgds

 

You could try reading the VariationalCalculus[EulerLagrange] help page - sounds vaguely relevant!

First 197 198 199 200 201 202 203 Last Page 199 of 207