Christian Wolinski

MaplePrimes Activity


These are replies submitted by Christian Wolinski

@Carl Love I was suspecting that by now Maplesoft developed a feature for this.

@Majmaj Since precision is your issue the last line should be with increased Digits. Pick the appropriate setting; I used 2*Digits:


moreDigits:=2*Digits;
S:=evalf(`@`(f,op,map2)(op,1,B),moreDigits),`@`(op,map2)(op,3,B);

evalf((minimize..maximize)(S),moreDigits);

or in one line:

moreDigits:=2*Digits;
evalf((minimize..maximize)(`@`(f,op,map2)(op,1,B),`@`(op,map2)(op,3,B)),moreDigits);

To answer your question: floats are imprecise, treat them as ranges.

@Majmaj My version does it differently. This should work with current version:

 

vars:=a,b;
Aexpr:=a*b;
f:=unapply(Aexpr,vars);
A:=a=.123456789,b=.123456789;
B:=map(`@`([proc(r) local k; (rhs-lhs)(r)*k+lhs(r), k, k=0..1 end proc], `@`(op,shake)), subs([A], [vars]));
S:=`@`(f,op,map2)(op,1,B),`@`(op,map2)(op,3,B);
(minimize..maximize)(S);

What do you ge tfor value of S?

From the first set I specified:
`@`(rationalize,factor,simplify)(u,[Z^2*Omega^2*a^2-k*m],[k, Z]);

gives:
mul(i,i = (-1/4, 2^(1/2), add(i,i = (-1, mul(i,i = (-2, Z^2)), add(i,i = (1, mul(i,i = (4, Z^2))))^(1/2)))^(1/2), add(i,i = (1, add(i,i = (1, mul(i,i = (4, Z^2))))^(1/2))), 1/Z^2))


The rest follows.

@Markiyan Hirnyk You gave me a cause to look again. I dont recall my thoughts, so:

ee := proc() _EnvExplicit := false; op([1, 2], [eliminate](args)) end proc;
Q:=ee({P,-1+V=something},{V,Z});

#gives

Q:={4*k*m-2*Omega^2*a^2*something-Omega^2*a^2*something^2};

#and

assume(something<-2),`@`(normal,simplify)(u,Q,[k,something]);

#gives

-I

Q and something are well motivated and easier to see. So start over:

restart;
A := a, positive, k, positive, Omega, positive, m, positive, -something - 2, positive; assume(A);
Q := -4*k*m+2*Omega^2*a^2*something+Omega^2*a^2*something^2;
u:=-Omega*a*sqrt(2)*sqrt(-Omega^2*a^2-2*k*m+sqrt(Omega^2*a^2*(Omega^2*a^2+4*k*m)))/(-Omega^2*a^2+sqrt(Omega^2*a^2*(Omega^2*a^2+4*k*m)));

`@`(normal,simplify)(u,[Q],[k,something]);

#gives

-I

What is the actual system you are trying to solve?

consider this sample:

interface(version);
# Maple Worksheet Interface, Release 4, IBM INTEL NT, Apr 16 1996

#base:

makefn := proc(Expr, Args::list({name, name::type}))
local x, q, f;
    f := subs(q = 'Expr', subsop(1 = op('Args'), setattribute(unapply(q, x))));
    f := setattribute(eval(f), operator, arrow)
end:
values := proc(x::uneval) 'values'(x) end;
`type/values` := proc(a, n) evalb('a' = eval(n)) end;

#implement:

f1:=makefn('det'(m),[m::'array'(1..values(dim),1..values(dim))]);
M2:=matrix(2,2):M3:=matrix(3,3):
dim:=2;d2:=f1(M2):f1(M3):dim:=3;d3:=f1(M3):

#Results:

 f1 := m::array(1 .. values(dim), 1 .. values(dim)) -> det(m)
 dim := 2
 Error, f1 expects its 1st argument, m, to be of type array(1 .. values(dim),1 .. values(dim)), but received M3
 dim := 3

 

Does the above function properly in your version of Maple?

@Markiyan Hirnyk The "answer" states only one thing: the restraint given has the same boundaries as another: signum((abs(x-a)-abs(x+a))*(2*abs(x-a)-1)) = 1. The regions are the same except for exclusion of x=a, due to the log base, shown in grey. Is this answer better?

 

Why did you edit your comment?

@vv 

bfrac:=(x->x)-floor;
F:=piecewise(x>=0 and x <= 1, x^2,x > 1 and x<=2, (2-x)^2);
f:=unapply(F,x);
plot(f,0..2,scaling=constrained);

P:=2*bfrac(x/2);
p:=(expand@unapply)(P,x);
plot(p,-8..8,scaling=constrained);
plot(f@p,-8..8,scaling=constrained);

Q:=unapply('q*(bfrac@((x->x)/q)),q');
p:=Q(2);
plot(f@p,-8..8,scaling=constrained,color=blue);
plot([f@Q(2),f@Q(4)],-8 .. 8,color = [khaki, black],thickness = [3, 0],numpoints = 101,axes=boxed,scaling=constrained);

From which science is this equation?

 

What are the values of the parameters and the solution range? Range of m is very important.

@acer Now I understand what you meant.

 

interface(version);

   Maple Worksheet Interface, Release 4, IBM INTEL NT, Apr 16 1996

This version certainly does not have this feature. All copies share the table and code. That the code is shared is not a problem, but the table sharing bugged me. A wrapper will do the trick. Thanks.

@acer ???? Can you word that plainly?.

@acer What result do you have with:

addressof(eval(op(4,eval(p)))), addressof(eval(op(4,eval(f))));

 

Unfortunately that code does not work with my version. I suppose I wil just have to neuter the procedure and put a wrapper around to externalize the remember table.

 

p:=proc(x) option remember; x^2; end:
p(3.4);op(4,eval(p));
f:=copy(eval(p)):op(4,eval(f));
[addressof(eval(p)), addressof(eval(f))];
[addressof(eval(op(4,eval(p)))), addressof(eval(op(4,eval(f))))];

11.56
table([3.4 = 11.56])
table([3.4 = 11.56])
[22017408, 22017408]
[1543892, 1543892]

@markweitzman

interface(version);

   Maple Worksheet Interface, Release 4, IBM INTEL NT, Apr 16 1996

 

My version is one of the firsts that had the graphical output and text input in graphical interface. Yours is one of the first(?) versions to have the graphical input. They had always wanted that. Which version introduced that mode first?

@asa12 you have the definition of 0 of your system, there are arbitrary presentations of your system. I am hoping that part is apparent and obvious to you.

rA := {c-a*s+a, s^2-s-a^2*s^2+2*a^2*s-a^2, b*s+a*s-a}, {-s^2+s+r^2}, [RootOf(_Z^2-s^2+s) = r];
X1:=`@`(`union`,op,[proc(L) L[1], map((x->0=x),L[2]) end],eliminate)(rA[1],{s});
X2:=`@`(`union`,op,[proc(L) L[1], map((x->0=x),L[2]) end],eliminate)(rA[1],{s,b});
X3:=`@`(`union`,op,[proc(E) map(`*`,E,1/b) end@select,remove])(has,X2,b);

First 16 17 18 19 Page 18 of 19