183 Reputation

9 Badges

16 years, 102 days

MaplePrimes Activity

These are replies submitted by mapj


Since you say that Maple handles the original problem well using the Eigenvalues(K,M) command, why bother with this lambda method at all?

What's the claimed advantage of this method? Speed or accuracy - it's not clear to me? 

If the high eigenvalues are of no interest to you, just ignore them as long as the low ones are accurate.  You can try to check this by running the problem several times while increasing the value of Digits (say from 15 (usual default for hardware precision) to 25 or 30 as required) and seeing if the low eigenvalues change significantly. Of course, Maple will slow down at high values of Digits but at least you will have some confidence about the accuracy.

If speed is an issue for large matrices, it may be better to use dedicated numerical software like Lapack, a numerical eigenvalue suite or Matlab (do a web search for some options). Maple is not always the best package to use.

It seem pointless to me to use the lambda method if Maple handles the original formulation well.



I may regret this reply, but surely the problem is now for you to solve. @vv has already given you good advice so why don't you experiment with different matrices and study how the method behaves? You could then report your findings here if you like.

As far as I can tell, this is no longer a Maple issue but probably a numerical issue, From what you provided, the two methods should give the same answers in the absence of numerical roundoff issues and for any value of lambda (except zero) since you claim they are mathematically equivalent.

As with all your questions, you get plenty of advice that you seem reluctant to work on. The good people like @vv and others give up their time to help others (including me). You need to study their advice and then do some work on your own rather than continually asking others to do it for you. It's your project after all.




This is my last reply as I think you have a basic misunderstanding. What you call B is not the Euler-Lagrange equation. The E-L equation is a differential equation, not an integral. It is the condition that make a functional a stationary value. Please consult a book on the calculus of variations to study this.

The Var package calculates the E-L equation(s) as I explained in my first post. It doesn't deal with boundary conditions, and you have to decide on these by yourself.

All this would become clear if you worked through my example

Good luck with your work.



As I explained, the integral is never used in Var, it is implied. Try my example and you will see that it works.



Install the library as per the instructions in the zip file. By the way, the package is called Var, not Calvar (my mistake).

Once it's installed you can use



to load the Var package.

Here's a simple example for Poisson's equation.

coordinates(x,y); fields(phi);  # coordinates are x and y; variable is phi(x,y)

# f = forcing function

potential:=1/2*(phi[x]^2+phi[y]^2)-f*phi;  # potential energy; phi[x] means dphi/dx (parital derivative) etc

# this means that the total potential energy is the integral over the region of "potential"

# the region integral is not defined, just what is integrated, so the above statement implies TotalEnergy = int(potential,region)

# a second derivative would be written like phi[x,x] or phi[x,y] etc

euler:=variation(potential,phi);  # euler-lagrange equation

If you have more coordinates, just say coordinates(x,y,z); etc

If you have more variables, use fields(phi1,phi2);  etc and then



to get the two E-L equations.





1. Where is Re(b(x)) defined? 

2. If you know b(0) and b(8), this is a boundary value problem and not an initial value problem.

3. You divide by b(x) in various terms. How do you know that b(x) never equals zero?

4. x = 0 also can cause problems because you divide by x in various terms.


It's now not clear to me what you want. You originally wanted to solve the pde. Now you are looking at a variational approach. These are quite different. The variational approach avoids working directly with the pde but gives an approximate solution. If you want to use this approach, the boundary conditions place restrictions on the assumed trial functions.

I still think your problem is with the basic theory and not Maple. Maple or any other software can't help you with the formulation of the problem.

I can only repeat that you study standard books on plates and variational methods. They give examples of what you want to calculate. Once you understand the theory, then you should be able to use Maple to help you solve the problem.





From the picture you attached, the required boundary conditions are the first four lines. These are the "simple support" conditions for an orthotropic plate bending problem if your w is the transverse displacement of the plate.

The G term suggests you are looking at the buckling of the plate under a shear load. This leads to an eigenvalue problem. One way to solve this is to use a double Fourier expansion of w(x,y). The book you got the picture from should have the details. If not, look at a book on plate theory.

By the way, analytical solutions of plate problems are not always simple, and sometimes can't be found. You are usually better off going for a numerical solution, such as finite elements.




@Carl Love 

This is great.

I wasn't aware of this behavior but it seems the easiest way to avoid the memory problem and the problem felixp was having.



@Carl Love 

Thanks again for an interesting explanation.


@Carl Love 

Thanks Carl for the explanation.

It seems strange to me that your code works while what felixp is doing doesn't.

In my silly example, if the task was to replace M[i,j] by M[i,j]*x^i*y^j for all terms in M, this could be done with two loops in your procedure.  This changes every term in M, which to me is not much different to a direct assigment to M in the original procedure by felixp.

I view this as inconsistent behavior by Maple, but others may disagree.


@Carl Love 

Thanks for clarification. Is inplace always possible?

Say I want to write a procedure that can't use an existing command from LinearAlgebra.

Silly example: Write a procedure with arguments M,i,j,x,y so that

M[i,j] is replaced by M[i,j]*x^i*y^j.

Will it always be possible to do something like this without using inplace or a global variable and avoiding using a copy of M?



@Carl Love 

Just a comment on the local M1. I presume your solution uses twice the memory required to store M. This could be an issue for large matrices.

Is there another way to do this that avoids the memory issue? Making M a global variable should work but it seems inelegant to force the user to always use 'M' as the argument name in the calling program.



LPSolve and NPSolve are used to optimize a function f of the unknowns like

f = 2*x1 + 3*x2 for LPSolve


f = 2*x1^2 + 3*x2^3 for NPSolve

subject to some constraints on the variables x1 and x2.

Your code seems to trying to solve two equations for some variables which is a different problem.

You need to clarify what you are trying to do.





If you read the procedure into Maple with


as the last line, it will print the procedure out with a local statement that defines all the local variables. Copy the local line into your procedure and you are done.




1 2 3 4 5 Page 2 of 5