vv

14257 Reputation

20 Badges

11 years, 12 days

MaplePrimes Activity


These are replies submitted by vv

@Klausklabauter 

It's not clear (at least for me) what is your final goal.
If you want the LDL decomposition then you can obtain it with 3 lines of code as shown. The complexity compared with a direct LDL algorithm is almost the same. You must have huge matrices to see a (marginal) difference.

 

@Annonymouse 

Basis returns the primitive parts of the polynomials, i.e. applies the primpart procedure (see ?primpart) to the "true" reduced basis. Note that this "basis" is also unique and has the advantage of not having non-integer coefficients.

It would be interesting to try this for t=1/10 instead of t=1.

@Mariusz Iwaniuk 

@weidade37211 

restart;
interface(version);

 Standard Worksheet Interface, Maple 2018.1, Windows 7, June 8  2018 Build ID 1321769
with(Statistics):
p1 := RandomVariable(BetaDistribution(1, 100)):
p2 := RandomVariable(BetaDistribution(1, 50)):
CodeTools:-Usage(
evalf(Int(z*PDF(0.3*p1+0.7*p2, z, inert), z = 0 .. 1))
);

memory used=0.56GiB, alloc change=142.00MiB, cpu time=6.33s, real time=6.18s, gc time=530.40ms
                         0.01669578722

 

@weidade37211 

As you see, this way it's computed fast too.

@aarjav 
It works for me.
BTW, note that Zeta is a built in function (Riemann Zeta). Probably you want zeta.

Here is a procedure for this.


 

> 

restart;

> 

IgnoreTerms:=proc(Ex::`+`, vars::list(function))
local dd,ddd,DD,EX,F,Z,i;
dd:=[indets(Ex,specfunc(diff))[]]:
DD:=[seq(ddd[i],i=1..nops(dd))]:
EX:=eval(Ex, dd=~DD):
F:= u -> `if`(limit(eval(u, vars=~Z)/Z,Z=0)=0, 0, u):
eval(map(F, EX), DD=~dd);
end:

> 

alias(beta = beta(t), Zeta = Zeta(t), theta = theta(t));

beta, Zeta, theta

(1)
> 

YourEx := 2428.922250*(diff(beta, t, t))+33032*beta-18.43200000*cos(psi)*beta*(sin(delta__3)^3)*p*r-36.86400000*(cos(delta__3)^3)*Zeta*beta*(sin(delta__3)^3)*((diff(theta, t))^2)-429.7500000*U*cos(psi)*sin(delta__3)*Zeta*Zeta(1, t)+16342.88754*cos(psi)*(beta^3)*sin(delta__3)*q-3416.512500*V*sin(psi)*beta*sin(delta__3)*Zeta*(theta^2)-429.7500000*V*sin(psi)*sin(delta__3)*Zeta*Zeta(1, t)-16342.88754*sin(psi)*beta*sin(delta__3)*p*Zeta+9.216000000*sin(psi)*sin(delta__3)*(cos(delta__3)^4)*q*(diff(theta, t))-5809.338000*cos(psi)*beta*sin(delta__3)*p*(diff(theta, t))-3.456000000*cos(psi)*beta*sin(delta__3)*p*r+149.6160000*cos(psi)*sin(delta__3)*cos(delta__3)*p*Zeta(1, t)+149.6160000*cos(psi)*sin(delta__3)*cos(delta__3)*p*r+5805.882000*cos(psi)*beta*cos(delta__3)*q*(diff(theta, t))+2704.842000*cos(psi)*sin(delta__3)*q*Zeta*r+1.728000000*cos(psi)*sin(delta__3)*q*theta*(diff(theta, t));

2428.922250*(diff(diff(beta, t), t))+33032*beta-18.43200000*cos(psi)*beta*sin(delta__3)^3*p*r-36.86400000*cos(delta__3)^3*Zeta*beta*sin(delta__3)^3*(diff(theta, t))^2-429.7500000*U*cos(psi)*sin(delta__3)*Zeta*Zeta(1, t)+16342.88754*cos(psi)*beta^3*sin(delta__3)*q-3416.512500*V*sin(psi)*beta*sin(delta__3)*Zeta*theta^2-429.7500000*V*sin(psi)*sin(delta__3)*Zeta*Zeta(1, t)-16342.88754*sin(psi)*beta*sin(delta__3)*p*Zeta+9.216000000*sin(psi)*sin(delta__3)*cos(delta__3)^4*q*(diff(theta, t))-5809.338000*cos(psi)*beta*sin(delta__3)*p*(diff(theta, t))-3.456000000*cos(psi)*beta*sin(delta__3)*p*r+149.6160000*cos(psi)*sin(delta__3)*cos(delta__3)*p*Zeta(1, t)+149.6160000*cos(psi)*sin(delta__3)*cos(delta__3)*p*r+5805.882000*cos(psi)*beta*cos(delta__3)*q*(diff(theta, t))+2704.842000*cos(psi)*sin(delta__3)*q*Zeta*r+1.728000000*cos(psi)*sin(delta__3)*q*theta*(diff(theta, t))

(2)
> 

YourResult := 2428.922250*(diff(beta, t, t))+33032*beta-18.43200000*cos(psi)*beta*(sin(delta__3)^3)*p*r-429.7500000*U*cos(psi)*sin(delta__3)*Zeta*Zeta(1,t)-429.7500000*V*sin(psi)*sin(delta__3)*Zeta*Zeta(1, t)+9.216000000*sin(psi)*sin(delta__3)*(cos(delta__3)^4)*q*(diff(theta, t))-5809.338000*cos(psi)*beta*sin(delta__3)*p*(diff(theta, t))-3.456000000*cos(psi)*beta*sin(delta__3)*p*r+149.6160000*cos(psi)*sin(delta__3)*cos(delta__3)*p*Zeta(1, t)+149.6160000*cos(psi)*sin(delta__3)*cos(delta__3)*p*r+5805.882000*cos(psi)*beta*cos(delta__3)*q*(diff(theta, t))+2704.842000*cos(psi)*sin(delta__3)*q*Zeta*r+1.728000000*cos(psi)*sin(delta__3)*q*theta*(diff(theta, t));

2428.922250*(diff(diff(beta, t), t))+33032*beta-18.43200000*cos(psi)*beta*sin(delta__3)^3*p*r-429.7500000*U*cos(psi)*sin(delta__3)*Zeta*Zeta(1, t)-429.7500000*V*sin(psi)*sin(delta__3)*Zeta*Zeta(1, t)+9.216000000*sin(psi)*sin(delta__3)*cos(delta__3)^4*q*(diff(theta, t))-5809.338000*cos(psi)*beta*sin(delta__3)*p*(diff(theta, t))-3.456000000*cos(psi)*beta*sin(delta__3)*p*r+149.6160000*cos(psi)*sin(delta__3)*cos(delta__3)*p*Zeta(1, t)+149.6160000*cos(psi)*sin(delta__3)*cos(delta__3)*p*r+5805.882000*cos(psi)*beta*cos(delta__3)*q*(diff(theta, t))+2704.842000*cos(psi)*sin(delta__3)*q*Zeta*r+1.728000000*cos(psi)*sin(delta__3)*q*theta*(diff(theta, t))

(3)
> 

Result:=IgnoreTerms(YourEx,[beta,Zeta,theta]);

2428.922250*(diff(diff(beta, t), t))+33032*beta-18.43200000*cos(psi)*beta*sin(delta__3)^3*p*r-429.7500000*U*cos(psi)*sin(delta__3)*Zeta*Zeta(1, t)-429.7500000*V*sin(psi)*sin(delta__3)*Zeta*Zeta(1, t)+9.216000000*sin(psi)*sin(delta__3)*cos(delta__3)^4*q*(diff(theta, t))-5809.338000*cos(psi)*beta*sin(delta__3)*p*(diff(theta, t))-3.456000000*cos(psi)*beta*sin(delta__3)*p*r+149.6160000*cos(psi)*sin(delta__3)*cos(delta__3)*p*Zeta(1, t)+149.6160000*cos(psi)*sin(delta__3)*cos(delta__3)*p*r+5805.882000*cos(psi)*beta*cos(delta__3)*q*(diff(theta, t))+2704.842000*cos(psi)*sin(delta__3)*q*Zeta*r+1.728000000*cos(psi)*sin(delta__3)*q*theta*(diff(theta, t))

(4)
> 

Result-YourResult;

0

(5)
> 

 


 

Download IgnoreTerms.mw

@aarjav 

Your expressions are written incorrectly. You must use the argument t: so, theta(t) instead of theta etc.
Note that diff(theta, t) = 0, diff(beta, t, t) = 0 (without arguments).

[Actually it is possible to use alias(theta=theta(t)) but I'd recommend to avoid this at least for the moment].
Note also that zeta and Zeta are distinct objects.

It would be better to have either o formal description of the expression or a complete (not too long) example + the desired result.

@Rouben Rostamian  

Actually eq[2] is still undefined at (0,0,0). Maple does not see (without an extra simplify)  that the denominator is 0. 

@Carl Love 

The problem addressed by my answer was that strangely, fsolve is able to compute 4000 digits for z but not 5000.
Are you happy with this behavior?

It is strange that CubaCuhre works and other methods fail. After all, the function is well behaved so that any numerical integration should work. It seems that `evalf/MeijerG` is buggy.

@Carl Love 

Even when d=20 and we want 5000 digits for z (as above)?

@Mariusz Iwaniuk 

It seems that you have other integral in MMA.

@Markiyan Hirnyk 

Unfortunately you keep producing "anti-comments". It is a high school exercise to see that the equation 
arctan(x) = x/2 has 3 real roots and -tan(_Z) + 2 _Z = 0 has infinitely many real roots.

The important fact here is that RootOf uses a non-equivalent equation for the mentioned reason.

@Kitonum 

The name FrechetDistance for the procedure is misleading; this is actually a EuclideanDistance.
It would be interesting to compute the true FrechetDistance between the paths defined by P and Q.

First 84 85 86 87 88 89 90 Last Page 86 of 178