Kitonum

8125 Reputation

17 Badges

8 years, 228 days

MaplePrimes Activity


These are replies submitted by Kitonum

@Derein 

restart;
a:=0: b:=1.6: c:=4: d:=4.4:
f:=convert(abs(x-b)+abs(a-x)+abs(x-a)+abs(d-x)+abs(b-d), fraction):
m:=minimize(f, x=0..convert(d, fraction));  
# Minimum of the function  f
solve(f=m, x);
 # All values of variable x, that  f=m

                                            m := 44/5
                                      RealRange(0, 8/5)

@Zeineb  In your code 3 errors. Should be

with(DEtools):
DEtools:-DEplot(diff(x(t), t)-x(t), x(t), t = -1 .. 1, {x(0) = 1});

 

Just copy it to your worksheet and run.

@alyresa  If you want to direct the prism axis (from my answer above) along the vector (1,1,1), you can use the rotation transformation:

f:=piecewise(x>-1 and x<-1/2,sqrt(3)*(x+1),x>=-1/2 and x<=1/2,sqrt(3)/2,x>1/2,-sqrt(3)*(x-1)):
A:=plot3d(2, x=-1..1, y=-f..f, style=surface, color=khaki, filled):
with(plots): with(plottools): with(LinearAlgebra):
v1:=<1,1,1>: v2:=<0,0,1>:
v:=v1 &x v2;  
# The axis of rotation
phi:=arccos(v1.v2/Norm(v1,2)/Norm(v2,2));  # The angle of rotation
display(rotate(A, -phi, [[0,0,0],convert(v,list)]), axes=normal);

                  

 

 

@Derein   abs(x-b)  is the distance between the points  b  and  xabs(a-x)  is the distance between the points  a  and  x  and so on. So we get all the distance covered, that is  abs(x-b)+abs(a-x)+abs(x-a)+abs(d-x)+abs(b-d). This is a function of the variable x . The command  minimize  finds the minimum of this function if  x  changes in the range  0 .. 4.4 . The problem has not the unique solution. The minimum equal to  8.8  and is achieved for all  x  in the range  0 .. 1.6

@nk2016

restart;
A:=-(cos((t/n)+t))/(sin((t/n)+t)):
sol:=solve(denom(A)=0, t, allsolutions):
indets(%)[1]:
h:=subs(%=1, sol):
r:=cos(t/n)^n:  r2:=eval(r, n=4):
x:=r2*cos(t):  y:=r2*sin(t):  
H:=seq(eval([x,y],n=4), t=[seq(h*i,i=0..4)]):
PP:=seq(plots:-display(plottools:-disk(H[i],`if`(i in [1,2,5],0.015,0.001), color=red)), i=1..5):
plots:-display(<plots:-display(PP, plot(r2, t=0..4*Pi, coords=polar, color=blue), title="The points at which the tangent is parallel to the axis Oy")| plots:-display(PP[3],PP[4], plot(r2, t=0..4*Pi, coords=polar, color=blue), view=[-0.05..0.05,-0.05..0.05], title="Zoom 20:1 near the origin")>, scaling=constrained);

 

Curves.mw


 

@nk2016   The addition to the previous code:

H:=seq(eval([x,y],n=4),t=[seq(h*i,i=0..4)]):
PP:=seq(plots:-display(plottools:-disk(H[i],`if`(i in [1,2,5],0.015,0.001),color=red)), i=1..5):
plots:-display(<plots:-display(PP, plot(r2, t=0..4*Pi, coords=polar, color=blue), title="The points at which the tangent is parallel to the axis Oy")| plots:-display(PP[3],PP[4], plot(r2, t=0..4*Pi, coords=polar, color=blue), view=[-0.05..0.05,-0.05..0.05], title="Zoom 20:1 near the origin")>, scaling=constrained);            

@asa12   

Prefix1:=proc(Expr)
if type(Expr, `*`) then return func1(Prefix1(op(1,Expr)), Prefix1(`*`(op(2..-1,Expr)))) else
if type(Expr, `+`) then return func2(Prefix1(op(1,Expr)), Prefix1(`+`(op(2..-1,Expr)))) else
if type(Expr, `^`) then return func3(Prefix1~([op(Expr)])[ ]) else
Expr  fi; fi; fi;
end proc:

 

Example of use:

Prefix1(a+b+c+d+e*c*d);
                               func2(func1(e,func1(c,d)),func2(a,func2(b,func2(c,d))))

 

 

@sumitzanje  It is easy to prove, that if we consider a[0], a[1], a[2], a[3], omega[s], L  as arbitrary constants, then your system is inconsistent. 

In fact, if we solve the system without the first equation, we get 2 solutions. If we now substitute these solutions in the first equation, then we do not get any identity:

restart;
Sys:={a[1]=sqrt((4*mu)/(3*alpha*omega^2)),a[2]=(2*beta*mu)/(9*alpha*omega^2),a[3]=sqrt(mu^3/(432*alpha*omega^2)), omega[s]=omega-(mu^2/16*omega)-((2*beta^2*mu)/(9*alpha*omega))};
Sol:=solve(Sys, {alpha,beta,mu,omega});

eval(a[0]=L+(2*beta*mu)/(3*alpha*omega^2), Sol[1]);
eval(a[0]=L+(2*beta*mu)/(3*alpha*omega^2), Sol[2]);

@dharr  I added 2 more ways to my answer and also uploaded the worksheet.

@nk2016   You do not have to type anything. Just copy it as text into the window of your worksheet and press the "Enter" key.

@Zeineb   if  F=1

@spalinowy  Why copy manually? In the file the simplified system has the name  Sys, and it can be used for further work with the system using the desired packages.

@spalinowy   I removed all called packages, including MTM, made restart at the beginning of the worksheet. Now it works.

Model_Maple3.mw

@spalinowy  Put here your system, or the link to the worksheet.

Should be  

MTM:-solve(5*x-3 = 19);

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