Kitonum

21500 Reputation

26 Badges

17 years, 61 days

MaplePrimes Activity


These are answers submitted by Kitonum

See help on  ?background

If now you just want to get the value of the polynomial  v(x)  for the found parameter values  a  and  b, then execute the following in the end of the code:

v(x);
                           
 (1/2)*x^2-(1/6)*x^3+2/3*x

Your expression  yy  is identically 0 for any  z :

 

Maple will understand what you want if you do so:

restart;
with(LinearAlgebra):
u := <u1, u2>;
v := <v1, v2>;
A:=<u | v>;
B := Transpose(A).A;


 

restart;
r := 1.9;
i := floor(r);

 

You can use  Student:-Calculus1:-Roots  command to find all the real roots in the specified interval. It does not need  maxsols  option and can work symbolically.

Examples:

Student:-Calculus1:-Roots(eq, beta=-10..10);
Student:-Calculus1:-Roots(sin(x), x=-10..10);

 

Of course in the real domain it is better to write  int(tan(x), x) = -ln(abs(cos(x)) . The same for the integrals  int(1/x, x) , int(1/(x^2-1), x)  and so on. But the result of Maple is also correct, since it works by default in the complex domain and the results may differ by a complex constant. See

simplify([ln(-2), ln(-5)]);
                                           
[ln(2)+I*Pi, ln(5)+I*Pi]

Since, as you can see, the results have the same complex constant, the final result is correct when calculating certain integrals using the Newton – Leibniz formula:

A:=int(tan(x), x);
B:=int(tan(x), x=2*Pi/3..3*Pi/4);
C:=``(expand(eval(A, x=3*Pi/4))) - ``(eval(A, x=2*Pi/3));
expand(C);
              

                                               

The first result  B  ( cos(x)<0  in this range  2*Pi/3..3*Pi/4 ) is calculated by Maple, and the second one  C  is calculated directly by the Newton-Leibniz formula. The results are the same and correct.

Probably a more complete answer why Maple is designed in this way, the developers of  int  procedure can give you.

Unfortunately Maple hangs when trying to compute it symbolically. However, for practical applications, a numerical solution is sufficient. The procedure  V  numerically finds the volume of intersection of two spherical caps (your picture below).

restart;
V:=proc(r,h,h__a)
local r0;
Digits:=20;
r0:=sqrt(2*r*h-h^2);  # This is the base radius of the top cap
if not (is(h>0) and is(h<=r) and is(h__a>r-r0) and is(h__a<=r)
) then error "Invalid arguments" fi;
evalf(Int(1, [z=r-h..sqrt(r^2-x^2-y^2),y=-sqrt(r0^2-x^2)..sqrt(r0^2-x^2),x=r-h__a..r0]));
end:

Examples of use:

V(1, 0.8, 0.6);
V(1, 0.1, 0.5);
V(1, 1, 1); 
# This is a quarter ball radius 1
evalf(Pi/3);  # Check

Edit.

I simplified your code by removing unnecessary indexes and replacing the for-loop with  seq  command. You can check that there are no real solutions for thetabn > 43*Pi/100 :

restart;
v := 145000;
thetavn := (1/6)*Pi;
omegac := 0.1;
s := v*cos(thetavn)*(cos(2*thetabn)*tan(thetabn)+sin(2*thetabn)*sin(omegac*t)/omegac);
 Data:=[seq([thetabn, solve(s = 0, t)], thetabn=[seq(Pi*k/100, k=1..43)])];
plot(Data);


 

You can define expr using the  piecewise  command:

expr:=piecewise(b<>a^3, (a-b)/(b-a^3), undefined); 

Examples of use:
eval(expr, [a=2,b=8]);
eval(expr, [a=2,b=7]);

 

Unfortunately Maple can simplify this only for a specific  L  and a specific  f :

restart; with(IntegrationTools):
L:=3:
int(f(x), x = 0 .. L*Ts)-Split(int(f(x), x = 0 .. L*Ts), [seq(i*Ts, i = 1 .. L-1)]);
eval(%, f=sin);
       

 

 

 

Here it works:

is(5^(x-1)=5^x/5);
                                          
true

First we solve this system as a system of equations, leaving only one inequality  p[1, 2] > 0 . We see that the solution depends on only one positive parameter p[1, 2] (the straight line from the solutions in 3D). So easy to get a general solution:

S:={0 < p[1, 2], p[1, 1] < 2*p[2, 2]+(3/2)*p[1, 2], p[1, 2]^2/p[2, 2] < p[1, 1], (2/3)*p[1, 2] < p[2, 2]};
solve({0 < p[1, 2], p[1, 1] <= 2*p[2, 2]+(3/2)*p[1, 2], p[1, 2]^2/p[2, 2] = p[1, 1], (2/3)*p[1, 2] = p[2, 2]});
{p[1, 1] = 3*p[1, 2]*(1/2), p[2, 2] > 2*p[1, 2]*(1/3), 0 < p[1, 2]}; 
# This is the general solution
eval(S, {p[1,2]=6, p[1,1]=9, p[2,2]=5});  # Check
              

 


 

restart:
with(combinat):
with(ListTools):

MM:=composition(7, 3);
convert(%, list);
Categorize((X,Y)->X in permute(Y), %);
map(t->t[1], [%]);  # The final result

{[1, 1, 5], [1, 2, 4], [1, 3, 3], [1, 4, 2], [1, 5, 1], [2, 1, 4], [2, 2, 3], [2, 3, 2], [2, 4, 1], [3, 1, 3], [3, 2, 2], [3, 3, 1], [4, 1, 2], [4, 2, 1], [5, 1, 1]}

 

[[1, 1, 5], [1, 2, 4], [1, 3, 3], [1, 4, 2], [1, 5, 1], [2, 1, 4], [2, 2, 3], [2, 3, 2], [2, 4, 1], [3, 1, 3], [3, 2, 2], [3, 3, 1], [4, 1, 2], [4, 2, 1], [5, 1, 1]]

 

[[1, 1, 5], [1, 5, 1], [5, 1, 1]], [[1, 2, 4], [1, 4, 2], [2, 1, 4], [2, 4, 1], [4, 1, 2], [4, 2, 1]], [[1, 3, 3], [3, 1, 3], [3, 3, 1]], [[2, 2, 3], [2, 3, 2], [3, 2, 2]]

 

[[1, 1, 5], [1, 2, 4], [1, 3, 3], [2, 2, 3]]

(1)

 


 

Download code_new.mw

Or replace the last line with:

work := simplify(work, {G*M/R^2 = g});
                                                                   
work := m*h*g

First 102 103 104 105 106 107 108 Last Page 104 of 290