vv

13805 Reputation

20 Badges

9 years, 310 days

MaplePrimes Activity


These are replies submitted by vv

@acer 

Nice post. Do you have such a tricky int example at hand?

@ecterrab 

Thank you for the answer. I know about op(procname). A concrete example can be seen with showstat(log).
The question is about documentation. It should be under ?functions but it is probably elsewhere. Or, is it not documented?

@Abdoulaye 

Yes, it's possible to use a Riemann sum (or a numeric integration method such as Simpson's) but I don't see why, because an interpolation is anyway needed after that (otherwise the complexity will grow exponentially and it will be impossible to compute e.g. F4 or even F3).

@Abdoulaye 

You may try the following:

- Fix a (uniform) grid X = [x0,...,xM], Y=[y0,...,yN] 

- After computing Fn at the points of the grid (xi,yj), replace Fn with its SplineInterpolation SFn. This way SFn can be integrated, producing (probably) useful approximations for the next iteration. Do the same for Un.

N.B. I am sure that there are better methods for your (undisclosed) original problem.

 

 

 

 

 

@MDD 

So, you want "disjoint" monomials.

restart;
vars:=[x,y,z]:
m1,m2,m3:= (a-b)*x*y*z^2, c*x^3, 3*b*y*z^2:
DisjMon:= (m1,m2,vars::list(name)) -> not depends(gcd(m1,m2), vars):
DisjMon(m1,m2,vars), DisjMon(m2,m3,vars), DisjMon(m1,m3,vars);

                                  false, true, false

@MDD 

EqMon tests if two terms have the same monomials, with possible distinct coefficients.
Define exactly what you want to test. Your example is not relevant and you have a typo.
 

@9009134 

Here is the the [2,3] integral.

Digits:=15:
ti:=time[real]():
F23:=(3/4*(501230769273.847*cos(theta)^2*r^2+5012307692738.48*r*cos(theta)+12530769231846.2)*sin(theta)*r^4*cos(theta)*cos(3*phi)/(5+r*cos(theta))^4-3/4*(.835384615384617e-1*cos(theta)^2*r+278461538504.616*cos(theta)^2*r^3+.139230769230770*cos(theta)+2784615385046.16*cos(theta)*r^2+6961538462615.36*r)*r^2*sin(theta)*cos(3*phi)/(5+r*cos(theta))^3-.710076923076924*sin(theta)*r^2*cos(theta)*cos(3*phi)/(5+r*cos(theta))^2-.229730769230770*r*sin(theta)*cos(3*phi)/(5+r*cos(theta))+.187961538461539*r^3*sin(theta)*cos(3*phi)/(5+r*cos(theta))^3+.187961538461539*sin(theta)*r^4*cos(theta)*cos(3*phi)/(5+r*cos(theta))^4-.417692307692310*r*sin(theta)*cos(3*phi)/(5+r*cos(theta))^2-.835384615384620*sin(theta)*r^2*cos(theta)*cos(3*phi)/(5+r*cos(theta))^3)*r^4*cos(theta)*cos(3*phi):
temp:=int(F23, phi=0..2*Pi):
L:=[op(expand(temp))]:
add(op(1,J)*int( J/op(1,J), [theta=0..2*Pi,r=2/10..1], numeric), J=L);
time=time[real]()-ti;
#                        1.09206001690410*10^(-6)
#                          time = 0.427

N.B. It would be nice to isolate yourself the problem before posting.

@acer 

I thought that these local variables have another status.
So, they differ from the regular ones, only by being "quasi" inaccessible.

@Carl Love  My question was not related to your original answer.

Thank you both for the clarification.

@Carl Love 

lambda is an escaped local variable, as in:

restart;
f:=proc()
local LOC:=13;
'LOC'
end proc:
f();
#                              LOC
%;
#                               13

My question: isn't LOC removed from the system after the first gc()?
How long is LOC going to survive?

@MDD 

You must provide a formal definition of "appear" for a question like

Does b-1 "appear" in G = [a*n*z^3-1, -b*x+3]   ?

Changing b-1 to c ==>

Does c "appear" in H = [a*n*z^3-1, -(1+c)*x+3]   ?

Does it?

 

@Carl Love 

A new kind of maths indeed :-)
But vote up for `diff/Zeta`.

@Mariusz Iwaniuk 

If f(n) = the number of positive divisors of n, I don't think you can define f'(3). Nobody can.

 

Do you really want to differentiate with respect to a natural number? Maybe you want fracdiff.

@Rouben Rostamian  

Yes, the existing numerical method is not stable, but a solution exists (even C^oo).
Must we change a sign and solve another problem, just because it has a stable numerical method implemented?
Maybe the method will work with some adjustments: in our example, adding 'abstol'=0.1  ==> OK for t=0..3.
Or, maybe a change of variables will help.

@Rouben Rostamian  

I don't agree entirely with your argument. The backward heat equation could work quite nicely sometimes.

For example,

sol:=pdsolve(diff(u(x,t),t) = -diff(u(x,t),x,x), {u(x,0)=sin(x), u(0,t)=0, u(Pi,t)=0}, numeric):
sol:-plot3d(u(x,t), x=0..Pi, t=0..1);

It fully agrees with the exact solution u(x,t)=sin(x)*exp(t).

 

First 59 60 61 62 63 64 65 Last Page 61 of 176