vv

13837 Reputation

20 Badges

9 years, 324 days

MaplePrimes Activity


These are replies submitted by vv

@ecterrab 

So, the help file says:

The eval option to subs also performs a full evaluation while keeping the semantics the same as for subs. This option should be used with care.

But your answer contains:
subs[eval] ... evaluate only the subexpressions where a substitution happened.

This explains the difference in my question. I think that the help file should contain this statement.
Now everything is clear. Thank you.

 

 

@ecterrab 

Thank you, the fix was really quick.
I still wonder about the difference between eval(subs(...)) and subs[eval](...) in my question.
Now, unlike value, the commands are builtin and unfortunalely the help page only mentions that the latter "should be used with care".

Happy New Year!

@Rouben Rostamian  

I think the behavior is intentional because it appears in an example (and in many help pages some essential information is found only in examples).
It is probably acceptable in the cases when the functions have always the same arguments. But othewise the results could be strange:

PDEtools[declare]();
diff(p(s,t),s) + diff(p(s,v),s) + diff(p(u,s),s);
    
p[s] + p[s] + p[s]
lprint(%);
     
diff(p(s,t),s) + diff(p(s,v),s) + diff(p(u,s),s);

 

 

 

@Christopher2222 

A default for an absolute width cannot exist because it should make visible the arrows for both vectors <0.5, 0.5>  and  <999, 999>.

@one man 

Yes, it works, but having direct access to the numerical procedures is usually easier and more flexible.

@Rouben Rostamian  

OK, I understand.  But at least if u0 is continuous, u is continuous everywhere (actually u(p) = ||p|| * u0(p / ||p||),  where ||.|| is the max norm (= infty norm), so it has a very simple form).

Edit. The problem has a solution. Using Perron's Method for the Dirichlet Problem, there exists even a harmonic u (in the interior of the cube) such that u is continuous at any continuity point of u0. Unfortunately a simple expression for u is not possible in this case; but we have uniqueness.

There are too many possibilities. There should be additional requirements.
For example, this simple construction works in any dimension. Let u0 be given on the faces.
For any p in the cube, p <> 0, let p' be the intersection of the half-line Op with the boundary of the cube.
Then an extension of u0 is given by u(p) := u0(p') * ||p|| / ||p'||,  u(0) := 0.
If u0 is continuous, u is continuous too. It's easy to give the analytic expression for u. 

@questerion 

So, your system has the form
Sum(Sum(a[i,j,k]*x[i]*x[j],i=1..n),j=1..n)=b[k];   # k=1..n

where a[i,j,k], b[k] are constants (k=1..n). If so, my remark applies.

You have no chance to solve your system this way unless most of the coefficients are zero.
For n unknowns x[i] and n quadratic equations the number of new unknowns s[i,j] = x[i]*x[j] is n*(n+1)/2.
Note that there are typically 2^n solutions for such a system.

@tomleslie 

Actually, det = 0. It appears to be small only due to roundoffs.

@Earl 

It's a minimal modification of Rouben's code.

restart;
with(plots):
r := <x(t),f(x(t))>:
v := diff(r,t):
v / sqrt(v^+ . v):
T := simplify(%):
N := < -T[2], T[1] >:
F := <0,-m*g> + n*N - mu*n*T*signum(diff(x(t),t)):
m*diff(v,t) =~ F:
DE := convert(%, list):
solve(DE, {diff(x(t),t,t), n}):
select(has, %, diff(x(t),t,t)):
de := %[]: 
myde := eval(de, {f = (x -> x^2), m=1, g=1, mu=1/10}):
ic := x(0)=0, D(x)(0)=1:
dsol1 := dsolve({myde, ic}, numeric, output=listprocedure):
pt:=eval(t, dsol1): px:=eval(x(t), dsol1):
tmax:=13.55:
parab:=plot([px(t),px(t)^2,t=0..tmax],color=blue):
animate(plot, [[[px(t),px(t)^2]],style=point,symbolsize=30], t=0..tmax, frames=100, background=parab);

 

                     

@acer 

In the floating point case the difficulty is inherent because the rank is not continuous wrt the matrix. The Rank function should return FAIL for a matrix for which the mathematical rank is not continuous. For example, Rank should return 2 for the matrix <1.,2.;3.,5.> and FAIL (or maybe 1..2)  for <1.,2.;3.,6.> and should depend on precision. All these in an ideal world.

@Mariusz Iwaniuk 

You should care because:

J:=Int(convert((cos(2*x))/(1+2*sin(3*x)^2), exp), x = 0 .. Pi/2):
evalf(J) = evalf(value(J));

    -3.452793607*10^(-14) = .3318985824+.2373064033*I

@Axel Vogt 

Actually it's enough to change the splitting points.

 

J:=Int(cos(2*x)/(1+2*sin(3*x)^2), x = 0 .. Pi);

Int(cos(2*x)/(1+2*sin(3*x)^2), x = 0 .. Pi)

(1)

with(IntegrationTools):

Split(J, [Pi/3, 2*Pi/3]);

Int(cos(2*x)/(1+2*sin(3*x)^2), x = 0 .. (1/3)*Pi)+Int(cos(2*x)/(1+2*sin(3*x)^2), x = (1/3)*Pi .. (2/3)*Pi)+Int(cos(2*x)/(1+2*sin(3*x)^2), x = (2/3)*Pi .. Pi)

(2)

op(1, %) + Change(op(2, %), x = Pi/3 + w) + Change(op(3, %), x = 2*Pi/3 + w);

Int(cos(2*x)/(1+2*sin(3*x)^2), x = 0 .. (1/3)*Pi)-(Int(sin((1/6)*Pi+2*w)/(1+2*sin(3*w)^2), w = 0 .. (1/3)*Pi))+Int(cos((1/3)*Pi+2*w)/(2*cos(3*w)^2-3), w = 0 .. (1/3)*Pi)

(3)

combine(%);

Int((sin((1/6)*Pi+2*w)+cos((1/3)*Pi+2*w)-cos(2*w))/(-2+cos(6*w)), w = 0 .. (1/3)*Pi)

(4)

expand(%);

Int(0, w = 0 .. (1/3)*Pi)

(5)

value(%);

0

(6)
First 70 71 72 73 74 75 76 Last Page 72 of 176