vv

5987 Reputation

18 Badges

3 years, 295 days

MaplePrimes Activity


These are replies submitted by vv

@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).

 

@sgils1 

Your problem is actually an integral (so, instead of dsolve, it's possible to simply use int).

Unfortunately, Maple does not find a continuous antiderivative in the symbolic case i.e. it is valid only locally.
(This is not a bug, it is documented; for example int(1/(2+cos(x)), x) is discontinuous and it is exactly the integral obtained by hand using the substitution tan(x/2)=t; note that for this example there is a simple continuous antiderivative, but in general a CAS does not try to find it).

For example:

restart;

H:=Heaviside;

Heaviside

(1)

int(H(a*x+b),x);

x*Heaviside(a*x+b)+Heaviside(a*x+b)*signum(a)^2*b

(2)

int(H(a*x+b),x) assuming a>0;

x*Heaviside(x+b/a)+Heaviside(x+b/a)*b/a

(3)

int(H(a*x+b),x) assuming a<0;

x-x*Heaviside(x+b/a)-Heaviside(x+b/a)*b/a

(4)

 

 

Here, (3) and (4) are continuous, but (2) is discontinuous.
The interesting fact is that (3) is also valid for a<0, but Maple does not care.

 

For your simple example, there are workarounds (looking for discontinuities and adding constants if needed; or use assuming).

 

@torabi 

Not quite useful. I was hoping to see an example where both input and output are Maple expressions.
I see instead a problem which must be formalized and has lots of unessential parameters such as lambda, mu, J2 etc which seem to be constants.
I don't know what the circled triple integral means. What is V? Why that change of variables? It is not clear what quantities are constans. I don't understand the assumption (4) ; Aijk are unique? Are Jijk etc given? etc, etc.
In conclusion, I cannot help here.

 

1 2 3 4 5 6 7 Last Page 1 of 115