Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 361 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@Kitonum The vast, vast majority of the extra time in my code was because I used sort rather than min. Here's a version where I coded my own Min.

restart:
ts := time():

S:= {$1..15}:
AllP:= [seq(P, P= Iterator:-SetPartitions(S, [[5,3]], compile= false))]:
lnp:= evalf(ln((`*`(S[]))^(1/3))):

Var:= proc(P::({list,set}(set)))
local r:= evalf(`+`(map(b-> abs(ln(`*`(b[]))-lnp), P)[]));
end proc:

Min:= proc(S::{list,set}, P::procedure)
local M:= infinity, X:= (), x, v;
     for x in S do
          v:= P(x);
          if v < M then  M:= v;  X:= x  end if
     end do;
     X
end proc:

Min(AllP, Var);

time()-ts;

   [{1, 8, 9, 11, 14}, {2, 3, 10, 12, 15}, {4, 5, 6, 7, 13}]
                             27.547

The ln and evalf still take a significant percentage of the time. I'm using 15 Digits, and some of the ln differences are only in the last of those digits.

I'm still waiting for Joe to show me how to use attributes for this.

I also have no problem using the END key. I'm using Windows 8, Maple 17.02/64-bit, Standard, Worksheet, 1D input.

We have a worse situation with is and floor:

is(floor(x)=0) assuming x>0, x<1;
                             false

@saysics 

The first problem is solved. Note that the error message is different. The problem now is that your system has a parameter T1 whose numeric value is not supplied in params.

Note that a listprocedure, as that term is used by dsolve(..., numeric), is not quite a list of procedures. It is a list of equations whose right sides are procedures. Specifically, it satisfies type list({name, function} = procedure).

Interesting that it will get it immediately if you replace sec(x)^2 with 1+tan(x)^2.

Another weirdness is

int(tan(x)^(1/3)*sec(x)^2, x= a..b, AllSolutions);

The answer is the same if I use 1+tan(x)^2.

@brian bovril Are you still restricted to 3 groups of 3, although now the products of the groups may possibly be unequal?

@candy898 Try this.

 

restart:

A:= Matrix([[.7, .3, .3], [.2, .6, .1], [.1, .1, .6]]);

A := Matrix(3, 3, {(1, 1) = .7, (1, 2) = .3, (1, 3) = .3, (2, 1) = .2, (2, 2) = .6, (2, 3) = .1, (3, 1) = .1, (3, 2) = .1, (3, 3) = .6})

macro(LA= LinearAlgebra):

The matrix A is singular, so it doesn't make sense to refer to 1/(I-A). Rather, we solve the system (I-A).X = 0.

Sol:= LA:-LinearSolve(convert~(LA:-IdentityMatrix(3)-A, rational), <0,0,0>);

Sol := Vector(3, {(1) = (5/3)*_t[2], (2) = _t[2], (3) = (2/3)*_t[2]})

solve({Sol[3]=100});

{_t[2] = 150}

eval(Sol, %);

Vector(3, {(1) = 250, (2) = 150, (3) = 100})

 




Download Leontief2.mw

Why are you setting the datalimit to such a small value? Of course it will run out of memory. I'd like to see the output of kernelopts(datalimit) before you make any changes to it. You obscure this information by ending the command with a colon.

I don't understand the question. Is it that you have a surface in a plot structure and you want to find eight points on that surface which are the vertices of a cube?

@candy898 

Replace LA with LinearAlgebra.

@candy898 What version of Maple are you using?

 

@saysics 

In the command

F := eval(-.2*s*Eta*r*u(t)*exp(-r^2/omega^2-t^2*1.177^2/tau^2)*cos(k*z-omega*t), params);

replace u(t) with U(t).

Do you have some reason to believe that Maple is not recognizing the amount of memory that you have?

What number do you get from the command kernelopts(datalimit)?

@saysics There was a mistake in my code in the specification of Eta. That did not affect the dsolve answer because Eta does not occur in the ODEs.

I had

Eta= 1.05457173*e-34

but it should be

Eta= 1.05457173e-34

First 579 580 581 582 583 584 585 Last Page 581 of 709