tomleslie

13876 Reputation

20 Badges

15 years, 174 days

MaplePrimes Activity


These are replies submitted by tomleslie

@asa12 

When you post a meaningful question, you *might* get a meaningful answer

Till then - bye, bye

I thinn I understandnd your complaint, but it would be much easier to investigate/diagnose this problem if I actually had a working example.

Debugging via reading-only is much harder than debugging  with execution capability!

So, I think I need the two equations which you have not supplied

@asa12 

"actually there is no input and ouput in the system"

  1. If a system has no output (ie, is a "perfect sink"), why do you define 'outputvariable = [a(t), c(t)]': if the system has no output , these cannot exist
  2. If a system has no input (ie, is autonomous, eg a free-running oscillator), why do you define  'inputvariable = [b(t)]'. If the system has no input, then defining one is superfluous
  3. If "there is no input and ouput in the system" then what do you expect to plot? Can't be the input because there isn't one: can't be the outputs, because there aren't any.
  4. So the "correct" answer is a blank graph?

Before we get to the dfieldplot() issue I think we need to clarify the following. You define your system as

sys := DiffEquation([eq2 = t, eq3 = t], inputvariable = [b(t)], outputvariable = [a(t), c(t)]);

However 'b(t)', which you have specified as your input variable is defined nowhere. Now in order to compute the output from your system, it is surely necessary to know the input!

Hence a definition of the function 'b(t)' would appear to be *mandatory*

BTW what is the purpose of eq4? It is assigned but used nowhere!

@Carl Love 

Should have been more precise - but OP was asking for "an explicit numerical solution"

So far as I am aware, Maple's PDE solvers are restricted to systems with two independent variables.

So if you have 3 then :-(

That is, unless you system is in some sense "separable" - maybe

related to the second part of this question??

http://www.mapleprimes.com/questions/209250-Manipulating-Series-Equations

After a bit of experimentation I stripped this problem to the following

  1. Create an Excel spreadsheet with the data 1,2 in cells B2,B3, and 3,4 in cells C2,C3, so basically we are talking the matrix [[1,2],[3.4]]
  2. When I attempt to import this into Maple using, ExcelTools:-Import("J:/Users/TomLeslie/myMaple/test2.xlsx", "B2:C3"); I get the error message "Error, (in ExcelTools:-Import) There was an error reading the Excel file"
  3. On the  other hand, if I read it without the cell area defintion, as in ExcelTools:-Import("J:/Users/TomLeslie/myMaple/test2.xlsx"), then it  reads without error. However it does start from the cell A1, so I get everything from A1 to C3. In other words the both the first row and first column are all zeros.
  4. Fundamental problem seems to be that if one specifies a "cell range", the import barfs. If one doesn't specify a celll range then one gets everything from A1 to where the data ends
  5. Seems to me the "cell range" option on the ExcelTools:-Import is causing problems?
  6. Bug?

@blob 

Only other thought I had since my previous post is that you found a solution for the KGE and I found three more.

Basic theory on PDEs requires that any linear combination of these solutions is also a solution. Now I did think about this - but to be honest I got nowhere.

Hell, I'm a chip designer, relativistic QM is a little out of my league!

@blob 

By doing a bit of doubtful(?) manipulation, I was able to come up with three explicit solutions.

pdetest() shows that these are all solutions of the original KG equation

Unfortunately each of these solutions has a singularity, which restricts the range over which they can be plotted/animated

I'm not sure whether this helps, but check out the attached

KGeqn.mw

@georgepan 

OK

"do i need to declare a step parameter like (D(y))(t) = u or is a command that can be applied automatically"

You do not need this - you have defined the 'step' parameter for the Runge-Kutta method as 'h'. This is the only 'step' parameter that you need.

However I do feel the need to restate

  1. Even when you clear up the issues with f() and V so that your variables are consistent,  you still have quite a bit of work to to, because you cannot apply the Runge-Kutta method (of any order) to a second-order differential equation - at least not directly. You have to convert the second-order ODE to a pair of first-order ODEs - and solve these simultaneously.
  2. The standard approach is to combine the two derived first-order ODEs in a 2D-vector, and apply the Runge-Kutta method in vectorial form. Amongst other things, this means (for example) that each of the k[1], k[2], k[3], k[4] now become 2D vector quantities

The OP has managed to upload a worksheet, which cannot produce the output "shown" in that worksheet!

Without executing this worksheet, just read the "supposed" output. Then execute the worksheet, and check to see if the same outputs are generated - they are not!

OP has a combination of fundamental errors:

  1. OP uses the function f() and the variable 'V' in this worksheet - neither are defined anywhere. Strangely the OP beileve that by supplying  non-numeric arguments (involving 'V') to an undefined function f(), a numeric answer will be provided!!?? On what planet?
  2. OP does not seem to realise that the Runge-Kutta method (of whatever order, and like all other numerical methods) can only be applied to either a first-order differential equation, or a system of first-order differential equations. OP supplies a second-order differential equation, with no reduction to a pair of first order equations, and expects to be able to solve it with a Runge-Kutta method (of whatever order)!!?? Again - on what planet!!
  3. Could I fix either/both of the above - well yes. But since OP is writing his/her own Runge-Kutta implementation, I am assumiing that this is some kind of homework exercise. Given this assumption, I am reluctant to fix anything until OP shows some deeper grasp of the problem (s)he is tring to solve

 

Perhaps if you supplied the vector field(s) you are trying to plot someone might be able to help. But since all you supply is two plots of two (possibly unrelated?) vector fields, no sensible comment is possible

Tend to agree with vv - this could get very complicated: for example, you have obviously missed several ways in which the rank of your matrix would be reduced (those depending on the values of l1,l2).

You might be able to check for the possibility of reduced rank, using the standard process of transforming the matrix to row-echelon form and checking whether it is possible for any of the rows to be identically zero, using something like (for your matrix Phi)

P:=GaussianElimination(Phi);
minRank:=add
                ( add
                  ( `if`
                    ( coulditbe(P[k,j]=0), 0, 1 ),
                    j = 1..ColumnDimension(P)
                 ),
                 k = 1..RowDimension(P)
              );

If the answer to the above is less than the number of rows in the matrix Phi, then the basic Rank() command *might* be producing a misleading answer.

You could extend this somewhat by restricting the values of certain parameters - for example in your case, you may know that 'l1', 'l2' !=0, which you could incorporate by prefacing the above with

assume( l1<>0, l2<>0);

But for the general of a mixture of functions, parameters, etc - this could get very complicated.

@Christopher2222 

When I said you could resize the plot, I wasn't varying the aspect ratio. You can do the former but not the latter. Maple 2015 and 2016 both exhibit this problem (at least on 64-bit Win7)

First 153 154 155 156 157 158 159 Last Page 155 of 207