Kitonum

21530 Reputation

26 Badges

17 years, 84 days

MaplePrimes Activity


These are answers submitted by Kitonum

Your function  Expression  has no critical points, since we have
diff(Expression, a)=80*cos(theta), diff(Expression, b)=30*sin(theta) ,
and the  sin(theta)  and  cos(theta)  are not equal to 0 for the same angle  theta  (because  (sin(theta))^2+(cos(theta))^2=1) .

Therefore, it makes sense only to search for the largest or smallest value of  Expression  on some set. In the example below, we find the largest value of the  Expression  on the set  {a>=0,b>=0,theta>=0,a<=1,b<=1,theta<=1} :

Expression :=30*a*sin(theta)+80*cos(theta)*b;
Optimization:-Maximize(Expression, {a>=0,b>=0,theta>=0,a<=1,b<=1,theta<=1});
     
[85.4400374531753073, [a = 1., b = 1., theta = 0.358770670270572]]

Addition. If you look for the maximum only by the changing the variable  theta  (with constants  a  and  b), here Maple makes a serious bug (see this post)

 

I think that your system with 3 parameters (c, d, k) is advisable to solve numerically for specific parameter values. The procedure  Sol  does this. You can play with it by selecting the desired values of the parameters and getting the corresponding values of  and  P .

restart;
Sys:=[c*(N-k)*(1-exp(-P))=P, -d*((k-N)*exp(-P)-k)=N];
Sol:=proc(L::list)
fsolve(eval(Sys,[c,d,k]=~L), {N=0..infinity,P=0..infinity}, avoid={N=0,P=0});
end proc:

#  Example of use:

Params:=[2,3,4]:  # The list of parameters (for example)
Sol(Params); # The solution of the system Sys
plots:-implicitplot(eval(Sys,[c,d,k]=~Params), N=0..2*eval(N,%), P=0..2*eval(P,%), color=[red,blue], thickness=2, gridrefine=3);  
# Visualization
               

 

Download System.mw

For example (for  F  from your worksheet):

F := plot([sigma1, sigma2], sigma = -15 .. 15, color = [RED], thickness = 2, legend = [" &xi;,=2, MCST(1) ", " &xi;=2, MCST(1)"]):
DataF:=plottools:-getdata(F);

# Then

op([1,3], [DataF]);
# Or
op([2,3], [DataF]);
 

 

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 102 103 104 105 106 107 108 Last Page 104 of 290