tomleslie

13876 Reputation

20 Badges

15 years, 172 days

MaplePrimes Activity


These are replies submitted by tomleslie

@ggill 

Your comment makes some sense: I'm running win7/64-bit, with a 64-bit version of Maple 2015 and a 32-bit version of Excel2010.

Obvious question - do I need a 32-bit version of the Maple add-in for Excel(ie a 32-bit version of the .xla file), or do I need a complete 32-bit Maple installation (alongside my everyday 64-bit Maple)

Actuallly, I suppose the "cleanest" way to fix this might be to upgrade my 32-bit Excel 2010 to 64-bit Excel 2010, although this would probably violate some obscure Microsoft licensing rules!!

@Axel Vogt 

Axel,

I think the OP is referring to use of the MapleMath icon in the MaplePrimes toolbar - bottom row, fourth from the right.

I can confirm that entering sqrt(5) in the popup, produces the desired output and sqrt(1+sqrt(5)) gives "You have entered an invalid Maple expression".

I have no idea why, and no idea how to debug this!

I had this set up several Maple/Excel versions ago, but rarely used it so it was not set up for my current versions (Maple2015, Excel2010) - so I thought I'd try!!

  1. Followed the instructions on the Maple help page
  2. I get Run time error 53 (not 453!), File not found WMIMPLEX
  3. If I look at the Excel add ins manager, then it contains the full path to the WMIMPLEX64.xla file
  4. Now every time I start Excel I get the same Run time error, unless I disable the Maple add in.
  5. Like you my HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Excel.exe Path key contains no reference to anything MAple-related. In fact it has exactly one entry -  C:\Program Files (x86)\Microsoft Office\Office14\
  6. I am exceeding reluctant to edit my registry, unless I am sure what to add and where!! Maple 2015 does not have a bin.win folder - although I suspect the "relevant" folder would be  bin.X86_64_WINDOWS
  7. I think this maybe one for Maple support - unless anyone else here can help

If the OP had given any indication that (s)he was using any of

  1. Code edit regions
  2. 2-D Input
  3. Document blocks

then I would probably not even have bothered to respond. My experience is that each/all of these can cause problems which I have little interest in solving.

Debugging 1Dmath/simpleCode is hard enough. Debugging (dodgy) assorted parsers which are incapable of producing sensible code is far too time-consuming

For "simple" worksheets, my comment stands.

@asa12 

From the manual, the following explains the arguments which you can use

Calling Sequence
SpecialUnitaryGroup(n, q)


Parameters n - a positive integer
                 q - power of a prime number

1 is not a prime number, so 1^(anything) is not allowed as the second argument for this command.

#################################################################

When I try your example, ie

G := SpecialUnitaryGroup(3, 2);

then my simple-minded examinations indicate that the resut is a permutation group. On what basis do you claim that

"the results are not permutation group"

 

(diff(f,y))^2-(f[y]^4)/4+q^2/(f[y]^2)+(1+2*q^2)*(f[y]^2)/2=piecewise(y<-a,1/4+2*q^2,-a<y<a,vn*(f[y]^2)-vn+1/4+2*q^2,y>a,1/4+2*q^2);

will always produce a sybtax error which you should fix: the part ,-a<y<a is not valid maple syntax, so the above should be written

(diff(f,y))^2-(f[y]^4)/4+q^2/(f[y]^2)+(1+2*q^2)*(f[y]^2)/2=piecewise(y<-a,1/4+2*q^2,-a<y and y<a,vn*(f[y]^2)-vn+1/4+2*q^2,y>a,1/4+2*q^2);

Now this expresssion contains quantities such as f, and f[y]. Should I guess that f is a function of y? As wriiten, the only conclusion I can draw is that f is an indexable entry (ie array, vector, list, table) and f[y] represemts an entry with one of these. Although in this case the quantity diff(f,y) is now difficult to determine. (It can have meaning, depending on the precise nature of the indexable quantity f)

If I now start guessing that actually, you don't mean f or f[y], but actually a simple function f(y), then the above should become

diff(f(y),y)^2-f(y)^4/4+q^2/f(y)^2+(1+2*q^2)*f(y)^2/2=piecewise(y<-a,1/4+2*q^2,-a<y and y<a,vn*(f(y)^2)-vn+1/4+2*q^2,y>a,1/4+2*q^2);

Now this a (reasonably) simple ODE, although (so far as I can tell) it does not have an analytic solution :-(

It may have a numeric sollution, but this would require a numeric value for 'a', and some kind of initial condition: eg if you want the solution from y=0 to some random positive value of of y, then f(0) would have be defined as a numeric.

Start clarifying!

Well, I wouldn't use 2-D input for a bet, because it has so many *interesting* features that I do not understand.

For example your procedure contains references to 'mu0' and 'μ0': in 2-D math input are these symbols considered identical? If so why do they display differently? Is it entirely random?

In your code, a similar question applies to the pairs

theta and θ
Pi and π
alpha[i] and αi

possibly others - I got bored checking

all of which appear, more or less at random, as far as I can tell. Are you happy with "random" variable names? cos it would scare the s**t out of me

Another odd feature of your code is that it uses the inert sum function Sum() (note capitalisation) on a fairly regular basis. I made the (possibly rash) assumption that you would be interested in numerical values only, so substituted the command 'add' for each instance of 'Sum'. This just produced the error message

Error, (in lisse) unable to execute add

In other words, there are sums of terms which cannot be evaluated to numerical values, either because the summands cannot be evaluated to numerical values, or the limits cannot. Did you expect this? It may (or may not) be related to the variable name issue mentioned earlier

I do not propose to address your overall problem. I read your "editled" version of the first procedure (L_gen) and decided that if all of your other procedures were written in a similar manner, my life would be too short for me to attempt a comprehensive debug.

Don't get me wrong - if someone posts a few dozen lines of really bad code, then I can (and wil)l debug. You however have a lot of procedures, each of which contains a lot of code, and each of which is very poorly written. This just represents too much debugging!

Consider the following rewirte of the procedure L_gen

L_gen:=proc(ai, aj, ak, bi, bj, bk, ci, cj, ck, di, dj, dk)
            #
            # the arguments  ax, ay, az, bx, b_y, bz, cx, cy,
            # cz, dx, dy, dz are not used anywhere so they
            # are deleted
            #
               local L, s, n:
            #
            # Add the passed arguments
            #
               s:= add( _passed )
            #
            # Create a list with entries 0 of the
            # appropriate length, based on the value
            # of s
            #
            # Actually probably better not to create
            # a list but to use a 1-D array because
            # the latter is mutable and the former is
            # not
            #
            # Question: what happens if the sum of
            # the arguments is outside the specified range?
            # Should an error trap be set?
            #
            # Otherwise OP will create a table anyway -
            # just without the initialisation - is this intended?
            #
                if      s >= 5 and s <= 8
                then L:= Array(1..s, fill=0)
                        L:= convert(L, list)
                fi;
                n:= 1;
            #
            # Loop through the passed arguments
            # reassigning list elements as specified
            #
            # Would be better with L an array, cos
            # arrays are mutable
            #
               for j from 1 by 1 to _npassed do
                    L[n]:=j:
                    if       _passed[j] = 1
                    then n:=n+1;
                    elif   _passed[j] = 2
                    then L[n+1]:=j
                           n:=n+2
                    fi;
               od;
               return L;
      end proc

Note that if I strip the comments, I can get it down to 20 lines - so not verbose, reasonably efficient, and relatively simple to debug.. (And I could probbaly reduce it further with some sacrifcie in legibility - but maybe a gain in efficiency?)

Can I guarantee that the above representation of L_gen is correct? Well, no: since you have only given an edited version, I can only operate on what I see. But if your "edited "version is functionally close to the "actual", then so is my representation

Always difficult to be precise when the OP only presents snippets of code, with bits missing. However you may want to think about the following

  1. The procedure f3() is called by nothing, anywhere, so I propose to ignore it
  2. The procedure f2() calls itself recursively, and there is no obvious exit/termination condition
  3. Depending on how the argument list for f2 is actually completed, I would have expected the recursive call of f2() to fail on the first recursion - incompatibility of the argument lists would seem to ensure this

You do not explain what happens

eg when attempting a numerical solution, what error message do you get (if any)

Really need more details - consider posting worksheet using big green up-arrow.

 

If one has [x=f(t), y=g(t)], then logically, you are looking for a function f-1(), such that t=f-1( x ), which one could then substitute in the expression for y, to obtain y=g( f-1( x ) ). The composition of the function g() and f-1() would provide the explicit expression which you require. Hoever this formal process can only be achieved when the function f(t) is single-valued (ie one-to-one): if the function is multiple-valued, then the inverse function cannot be computed (unless the domain is restricted.

As a "toy" example, consider [x=sin(t), y=cos(t)], the parametric definition of a circle, which can be computed in this form for any value of t. . Now write t=arcsin(x), so that "formally", y=cos( arcsin(x) ). However, this cannot be used as an "explicit" function for a circle because the arcsin() function is only defined over the domain [-1, 1]. Try plotting cos(arcsin(x)) over the range x=[-1..1] and see what you get

In the example of your worksheet both x and y are multple-valued functions of t - so inverse function coposition process cannot be made to work.

Another way to see this, is to look at the graph with caption "Piecewise Cubic Catmull-Rom Trajectory" and note that for certain values of x, there are three values of y. Which of these values would your "explicit function" select, and how?

I'm pretty sure that the only way such a process would be possible is when y is a single-valued function of x

I got to the second line of this file and read

x = x-f(x)*(D(f))(x)/((D(f))(x)^2-f(x)*((D@@2)(f))(x))

so, obviously, you mean that f(x)*(D(f))(x)/((D(f))(x)^2-f(x)*((D@@2)(f))(x)) is identically zero (otherwise how could x=x??). Hence no iteration can take place, and every subsequent entry in this file is based on a false premise

Read the attached, which gets a little further than my previous comment - but still no solution

rootIter2.mw

NB this is not an issue with Maple - just an admisssion that neither you,  nor I, know which mathematical operation we wish to perform

Well the "method" you cite is syntactically incorrect

This error is reasonably simple to fix (I think, see attached). However only you know how to proceed from this point. I assume that you are trying to demonstrate that your selected iteration method has quadratic convergence, even when roots have multiplicity >1. The mathematical steps to do this can (almost certainly) be implemented in Maple - you just have to know what these steps are. If you don't know, then I can recommend http://math.stackexchange.com

rootIter.mw

My previous comment and your response demonstrates one thing - you have no idea of the type or contents of the variables in you code. You may think that I am going to work this out for you - bad news: your posted code is too long and (frankly) too convoluted for me to do this. The only thing I can say is that you have no concept of the differences between a table, a matrix, a vector, and a function. Trust me these variable types are all different and cannot be used interchangeably or at random.

Give yourself a test: for each of the entities which you wish to compute - as an example consider- 'E_tot_net_Point': what is its type? Matrix?, Vector? Table? Function? Float? You do know - don't you? Or maybe you think I'm going to analyse your code line by line and work out for your??? Sorry, on something this length, that won't happen

If you think I am being harsh, then you have to realise that I have to analyse what you mean by statements such as

plt_P_tot_net_plt[t] := pointplot([t, P_tot_net_Point])

in your final execution group.

In this loop,  't' is a float and 'P_tot_net_Point' is also a float so the right hand side is a pointplot() of two floats, ie one point. This 'graph' of one point is then assigned to the left hand side plt_P_tot_net_plt[t], which would seem to be a table whose name is plt_P_tot_net_plt, indexed by the value of 't'. Now, it is just possible that you may want to produce mutiple plots of one point each, and store these one-point plots in a table - but somehow I doubt it. So if you don't want to stor muliple onr-point plots is a table - what do you think this line is doing??????

When you say "I have to change strategy", you mean that you have to think properly:

  1. What are my independent variables? Are they continuous or discrete?
  2. How can I compute my dependent variables? Do I have explict functions which allow me to compute dependent variables for any value of the independent variables? If no explicit functions are available can I only compute the dependent variables for specific values of the independent variables
  3. If you can't answer simple questions like this, you have no chance

 

@Command98 

I don't think the problem you are having is with the int() command itself - but rather with the value(s) of the integrand which you are supplying

In the code sequence

si := 0;
for g to Anzahl_SP-1 do
    P_tot_net_Fkt := te->(P_tot_nett[g]);
    si := evalf(Int(P_tot_net_Fkt(te), te = 0 .. 2));
end do;

For any value of 'g', P_tot_nett[g] is a constant float, so the function P_tot_net_Fkt(te), returns the same quantity for any value of 'te'.

Hence the integral evalf(Int(P_tot_net_Fkt(te), te = 0 .. 2)) is evaluating the area of a simple rectangle - so does not need to be performed numerically! int(P_tot_net_Fkt(te), te = 0 .. 2) will provide exactly the same result.

NB on each iteration through the loop, computed value of si will overwrite the previous value.

In order to check the above statements, check the execution groups I have added to the end of your worksheet

MPint.mw

 

 

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