acer

33325 Reputation

29 Badges

20 years, 279 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

After reading through all the followups in this thread, I would suspect that the problem is that the mount of a network filesystem is sporadically failing, and then the execution is aborted.

If that guess is the case, and if you are lucky then it could be due to Maple trying to write to a file in a directory whose NFS mount has suddenly disappeared. You might be able to work around that, for your very long maple sessions, by appending/writing/reading only to/from files on local disk, such as in the /tmp directory.

If it guess is the case, and if you are less lucky, then the networked mount point on which Maple resides may itself be failing now and then. To work around that, you could try installing Maple on local disk (eg. /usr/local for Linux/Unix).

Basically, if the appearance of .nfsXXXXXX files during each crash is a true indication that the problem is due to a sporadically failing network file system (NFS) then you may be able to work around it by having both Maple and all personal i/o data files be on local disk.

ps. anames(user) and any other variable values will not collide amongst different/distinct Maple kernels or running sessions of the commandline interface.

acer

@mehrdadparsapour 

If you look carefully enough at the results resturned by `solve` in both my and John's earlier answers you should be able to see that they do in fact contain such formulae. That is, they contain answers of the form a=..., b=... in terms of X.

But the right-hand-sides of those answers like {a=..,b=...} in terms of X are implicit RootOfs, and not explicit arithmetic formulae in terms of radicals.

You may not like that implicit RootOf form. But as I showed it is useful. Using evalf or fsolve following substitution of X by a float value (as I showed using evalf), all the roots for any given numeric X can be obtained. Hence, you can much more easily and reliably obtain all the roots of those RootOfs involving simple polynomials in X (for any given numeric X) than you can obtain roots of the system of equations using fsolve (for any given numeric X).

The extra RootFinding:-Parametric bit I added in my worksheet, before the `solve` stuff, was to show how many roots (ie. distinct sets of values for a,b,c,d) there are for separate ranges of real-valued parameter  X.

acer

A:=[($1..6)];

Matrix(3,2,[ListTools:-LengthSplit(A,3)],scan=columns,order=C_order);

acer

Try setting,

interface(prettyprint=1);

beforehand. That has the advantage that the result might be expressed tersely enough for you to gain whatever insight you'd expected to get by looking at it.

Or you could suppress the output using a full colon instead of a semicolon at the end of the line (and then figure out how to pick apart and make sense of the unviewable answer).

acer

You can use a mix of the RootFinding:-Parametric package and the `solve` command here.

Perhaps someone could check this over and explain how to reliably obtain the cell boundaries from RootFinding:-Parametric's results, in the single-parameter case. I find the output from CellDescription to be opaque.

param.mw

I was unable to insert the above worksheet's contents directly into this post, getting error messages from Mapleprimes about maplenet.

acer

The first version of Maple supported for Vista by Maplesoft was 11.01.

See here.

acer

If you use the Sockets package, then yes it should be possible for maple to negotiate the SMTP port connection and actually send the email (without `system` calls).

Look here, and perhaps in particular at the example.

I know at least one person who has claimed in conversation to have successfully written such an animal.

acer

Please stop posting duplicates of this earlier post of yours. Just correct the original, if you made mistakes in it, or in its uploaded worksheet.

What makes you think that the exact symbolic inverse of a (pretty general, even if triangular)  6x6 Matrix is going to be anything useful?

Is the non-blocked version of your C.C^%T singular? Did you really intend on having non-invertible blocks, or did you make a mistake in the code that creates each of them? Did you instead want all those entries to be distinct symbols, rather than identical-per-subblock?

What do you intend on doing with any solution, anyway? Are you planning on pumping in values for the x's, at some later time? Because if that is so then why not consider purely numerical solving? (You never responded to an earlier suggestion to a similar question, BTW.)

acer

C:=LinearAlgebra:-LUDecomposition(A,'method'='Cholesky','output'='L');

C.C^%T;

The option output=L is not necessary, as it is the default form returned for method=Cholesky. See here for lots more detail.

acer

> L:=[[name,4,3,6,5],[3,5,name],[3,6,1,2,9,8]];
[[name, 4, 3, 6, 5], [3, 5, name], [3, 6, 1, 2, 9, 8]]

> map2(remove,`=`,L,name);
[[4, 3, 6, 5], [3, 5], [3, 6, 1, 2, 9, 8]]

> map2(remove,`=`,L,3);
[[name, 4, 6, 5], [5, name], [6, 1, 2, 9, 8]]
> map2(member,name,L); [true, true, false]

acer

You can use the Matrix constructor for this, since it provides for an operator initializer of the entries.

c:=Matrix(2,2,(i,k)->i+k):
b:=Vector(2,(i)->i+1):

M:=Matrix(2,2,(i,k)->`if`(i=k,b[i],c[i,k]));

You can replace the 2,2 above with something that returns the dimensions directly. For example, since c above is a Matrix,

> op(1,c);
                              2, 2

So in this case you could also do,

M:=Matrix(op(1,c),(i,k)->`if`(i=k,b[i],c[i,k]));

And of course you could also use your formulae directly,

M:=Matrix(2,2,(i,k)->`if`(i=k,i+1,i+k));

acer

Yes, it should be possible to call such an engine from Maple. But it's likely that it would only be done indirectly, via an intermediary layer written in C, say, to translate between Maple and Mosek data structures and do Mosek initialization.

acer

You can try things like this,

> discont(diff(tan(x),x),x);
                                {Pi*_Z1+(1/2)*Pi}

> discont(diff(abs(x),x),x);
                                       {0}

There is also fdiscont, which uses floating-point approximations.

You might also try your luck a bit with `is` and `coulditbe`, although those wouldn't tell you where (they're for functionals, in this context?).

You can pick apart a piecewise with `op`.

acer

Are you using a full colon, after the outermost `end do`, to suppress output?

acer

> restart:

> e:= G*(.7500000000*B*sqrt((1.-2.*a+a^2)*B^2/(a^2+B^2-2.*B^2*a+B^2*a^2))-.7500000000*B*sqrt((1.-2.*a+a^2)*B^2/(a^2+B^2-2.*B^2*a+B^2*a^2))*a+.7500000000*a*sqrt(a^2/(a^2+B^2-2.*B^2*a+B^2*a^2))) + (1-G)*(-6.250000000*10^(-12)*sqrt(a^2/(a^2+B^2-2.*B^2*a+B^2*a^2))*(5.833333333*10^9*B*sqrt((1.-2.*a+a^2)*B^2/(a^2+B^2-2.*B^2*a+B^2*a^2))-7.500000000*10^9)*(4.*a-3.*B*sqrt((1.-2.*a+a^2)*B^2/(a^2+B^2-2.*B^2*a+B^2*a^2))+3.*B*sqrt((1.-2.*a+a^2)*B^2/(a^2+B^2-2.*B^2*a+B^2*a^2))*a-3.*a*sqrt(a^2/(a^2+B^2-2.*B^2*a+B^2*a^2)))^2-6.250000000*10^(-12)*(5.833333333*10^9*sqrt(a^2/(a^2+B^2-2.*B^2*a+B^2*a^2))-7.500000000*10^9)*B*sqrt((1.-2.*a+a^2)*B^2/(a^2+B^2-2.*B^2*a+B^2*a^2))*(4.-4.*a-3.*B*sqrt((1.-2.*a+a^2)*B^2/(a^2+B^2-2.*B^2*a+B^2*a^2))+3.*B*sqrt((1.-2.*a+a^2)*B^2/(a^2+B^2-2.*B^2*a+B^2*a^2))*a-3.*a*sqrt(a^2/(a^2+B^2-2.*B^2*a+B^2*a^2)))^2+0.3645833333e-1*sqrt(a^2/(a^2+B^2-2.*B^2*a+B^2*a^2))*B*sqrt((1.-2.*a+a^2)*B^2/(a^2+B^2-2.*B^2*a+B^2*a^2))*(4.-3.*B*sqrt((1.-2.*a+a^2)*B^2/(a^2+B^2-2.*B^2*a+B^2*a^2))+3.*B*sqrt((1.-2.*a+a^2)*B^2/(a^2+B^2-2.*B^2*a+B^2*a^2))*a-3.*a*sqrt(a^2/(a^2+B^2-2.*B^2*a+B^2*a^2)))^2+5.625000000*10^(-11)*(1.000000000*10^10+5.833333333*10^9*sqrt(a^2/(a^2+B^2-2.*B^2*a+B^2*a^2))*B*sqrt((1.-2.*a+a^2)*B^2/(a^2+B^2-2.*B^2*a+B^2*a^2))-7.500000000*10^9*B*sqrt((1.-2.*a+a^2)*B^2/(a^2+B^2-2.*B^2*a+B^2*a^2))-7.500000000*10^9*sqrt(a^2/(a^2+B^2-2.*B^2*a+B^2*a^2)))*(-1.*B*sqrt((1.-2.*a+a^2)*B^2/(a^2+B^2-2.*B^2*a+B^2*a^2))+B*sqrt((1.-2.*a+a^2)*B^2/(a^2+B^2-2.*B^2*a+B^2*a^2))*a-1.*a*sqrt(a^2/(a^2+B^2-2.*B^2*a+B^2*a^2)))^2):

> # first, get rid of those suspiciously simple looking floats.
> # (Isn't there as easier way to do this, btw??)

> f:=simplify(subsindets(e,float,t->10^10*identify(10^(-20)*(identify(identify(t)*10^10)))))
> assuming a>0, a<1, B>0, B<1, G>0, G<1:

> f:=simplify(f,size);
/ /
1 | |3 // 4 2 2 \ 4
------------------------- |3 |- (G - 1) ||B - -- B + 1| a
(3/2) \ \4 \\ 27 /
/ 2 2 2\
4 \(a - 1) B + a /

/ 4 4 2\ 3 / 4 2 2\ 2 4 4\
+ |-4 B + -- B | a + |6 B - -- B | a - 4 B a + B |
\ 27 / \ 27 / /

(1/2)
/ 2 2 2\ // 2\ 2 2 2\ //
\(a - 1) B + a / + \\1 + B / a - 2 B a + B / \\(G - 1)

\\
2 \ 3 / 2 \ 2 2 2\||
B - G + 1/ a + \(3 - 2 G) B + G/ a + B (G - 3) a + B /||
//

> ## That attains its (global w.r.t B and a) maximum when a=0, for any given G.
> ## If in doubt, I suppose one could plot it.
> ## It also attains a global max (w.r.t B and a) for all B along a=1, when G=1. See below.
> #plot3d(eval([e],G=1.0),a=0..1,B=0..1,axes=boxed); # or any G>0, G<1

> f_at_a_equals_zero := simplify(limit(f,a=0),size) assuming G>=0, G<=1, B>=0, B<=1;
1 2 3
-- (9 G - 9) B + - B
16 4

> maximize(f_at_a_equals_zero,B=0..1,G=0..1,location); # global max for all B and G, a=0
3 /[ 3]\
-, { [{B = 1, G = 1}, -] }
4 \[ 4]/

But the goal was to find the global maximum for each value of G, not the maximum over all G.

At G=1 the global maximum (in terms of a and B) also occurs all along a=1, and in fact it is constant there,

> eval(f,[a=1,G=1]);
3
-
4

> optB := solve(diff(f_at_a_equals_zero,B),B);
2
- ---------
3 (G - 1)

> simplify(eval(f_at_a_equals_zero,B=optB)); # the answer
1
- ---------
4 (G - 1)

> optG_func := unapply(%,G):

> optG_func(0.15);
0.2941176470

> optG_func(0.10);
0.2777777778

> optG_func(1/3),optG_func(1.0/3);
3
-, 0.3750000000
8

acer

First 296 297 298 299 300 301 302 Last Page 298 of 347