Kitonum

21760 Reputation

26 Badges

17 years, 203 days

MaplePrimes Activity


These are replies submitted by Kitonum

@nk2016 

eq:=diff(y(x),x)=sqrt(1+a*x+2*y(x)):
eval(eq, y(x)=-(1/2)*a*x+(1/8)*a^2-1/2);
is(%) assuming a<0;
A:=eval(eq, y(x)=m*x+c);
solve(coeff(op([2,1],%), x), m);
eval(A, m=%);
solve(%, c);

 

@taro  Because  this is a recursive procedure. If you put a semicolon instead of a comma in the example  P(A)  the procedure returns NULL. Every procedure returns only the last expression which is ending with a semicolon.

See this a toy example:

Proc:=proc(a,b)
a; b;
end proc:

Proc(1, 2);

                                        2

 

@Stupid Student  I do not use  Spread  package, but I looked out Help on it and did not find a possibility of programmatically control cell color. I think  DocumentTools:-Tabulate  might be a good replacement for spreadsheets.

@Ronan  I think the cause of the problem with transform  is 2d math,  which is very buggy. In 1d math everything is OK.

 

Anim_How-3new.mw

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

First 68 69 70 71 72 73 74 Last Page 70 of 134