Kitonum

21445 Reputation

26 Badges

17 years, 42 days

MaplePrimes Activity


These are answers submitted by Kitonum

There is a unique solution to this problem. In the code below the procedure  NumbersGame  from  here  was used:

L:=[$1..9]:

[seq(op(combinat[choose](8,i)), i=1..8)]:

M:=map(t->[parse(cat(op(L[1..t[1]]))),seq(parse(cat(op(L[t[i]+1..t[i+1]]))),i=1..nops(t)-1),parse(cat(op(L[t[-1]+1..-1])))],%):

Sol:=[]:

for k in M do

S:=NumbersGame(2016, k, ["+","-","*"]):

if S<>`No solutions` then Sol:=[op(Sol),S] fi;

od:

op(Sol);

                                     1 * 2 * 34 * 5 * 6 - 7 - 8 - 9 = 2016

 

Addition. Also there is a unique solution to this problem for numbers  1 .. 8

                                         1 * 2 + 345 * 6 - 7 * 8 = 2016

See help on  Statistics[LinearFit]  command.

expr:=(-(1/2)*ib-(1/2)*ia+ic)*vc+(-(1/2)*ia-(1/2)*ic+ib)*vb+(-(1/2)*ic-(1/2)*ib+ia)*va;

A:=algsubs(ia+ib+ic=0, expr);

subsop([3,2]=simplify(op([3,2], A), {ia+ib+ic=0}), A);

                      

 

 

 

The procedure  SM  solves your problem for both numeric and symbolic coefficients. Formal parameters: ex  - your expression,  U - the list of variables that determine the rows of the matrix, A - the list of variables that determine the columns of the matrix:

SM := proc (ex, U, A)

Matrix(map(t->[seq(coeff(t, A[i]), i = 1 .. nops(A))], map2(coeff, ex, U)));

end proc:

 

Examples of use:

ex1 := (3*a[1]+5*a[2])*U[1]+(-6*a[1]+2*a[2])*U[2];

ex2 := (A1*a[1]+B1*a[2])*U[1]+(A2*a[1]+B2*a[2])*U[2];

SM(ex1, [U[1], U[2]], [a[1], a[2]]);

SM(ex2, [U[1], U[2]], [a[1], a[2]]);

                          

 

 

 

To denote the second derivative, you must use two separate single quotes instead of one double quote (in Standard WorkSheet in document mode):

eq := diff(y(x), x$3)+3*(diff(y(x), x$2))+12*y(x):

dsolve({eq,  y(0) = a,  y’(0) = 0,  y’’(0) = 0}, y(x));

          

 

 

 

1) isolve  command just fails with your example.

2) It is easy to check that  your examples of solutions really are not solutions.

3) The plotting shows that the set of solutions of the system is located between two parallel lines

plots[inequal]({-13/74 < 7/37*f-2/37*g, -1/2 < 2/37*f+7/37*g, 2/37*f+7/37*g < -33/74, 7/37*f-2> 7*g, 7*g < 1/2}, f=-3..6, g=-5..1, scaling=constrained);

                          

 

4) We can find many integer solutions if we use the  IntegerPoint1  procedure from here 

Because this procedure works only for bounded regions, I added the extra inequality  f<100  to your system:

IntegerPoints1({(7/37)*f-2 > 7*g, -13/74 < (7/37)*f-(2/37)*g, -1/2 < (2/37)*f+(7/37)*g, f < 100, 7*g < 1/2, (2/37)*f+(7/37)*g < -33/74}, [f, g]);

 

Addition. If we analyze the results obtained, it is easy to obtain (and to prove) the general formulas for solutions.

 

 

restart;

A:=Matrix(100, 1, 1):

for k from 1 to 100 do

B[k]:=Matrix(subsop(k=[1.1], convert(A, listlist)));

od:

 

Matrix  B[k]  is different from the matrix   only  k-th column element.

Here is the procedure which solves the problem for addition. For subtraction,multiplication and division everything is similar.

Plus:=proc(a,b)

local P;

uses ListTools;

P:=proc(a)

local s, n;

s:=convert(a, string);

n:=length(s);

add(parse(s[n-i+1])*2^(i-1), i=1..n);

end proc:

parse(cat(op(Reverse(convert(P(a)+P(b), base,2)))));

end proc:

 

Example of use:

Plus(1101, 111);

                                     10100

 

Edit. For multiplication:

Multiplication:=proc(a,b)

local P;

uses ListTools;

P:=proc(a)

local s, n;

s:=convert(a,string);

n:=length(s);

add(parse(s[n-i+1])*2^(i-1),i=1..n);

end proc:

parse(cat(op(Reverse(convert(P(a)*P(b),base,2)))));

end proc:

 

Example:

Multiplication(1101,1011);

                                                       10001111

Try  algsubs  command.

Example:

algsubs(y^4 = f(y),  x*y+x^3+y^5+y^6);

expand(%);

                           

 

 

Pink umbrella with its projection on xy-plane. Here is my attempt:

 

P := piecewise(x > -2 and x < -sqrt(2), sqrt(2)*(x+2)/(2-sqrt(2)), x > -sqrt(2) and x < 0, (2-sqrt(2))*x/sqrt(2)+2, x > 0 and x < sqrt(2), (sqrt(2)-2)*x/sqrt(2)+2, x > sqrt(2) and x < 2, sqrt(2)*(x-2)/(sqrt(2)-2)):

F := plots[spacecurve]([3*sin(theta), 0, 3*cos(theta)], theta = 0 .. arcsin(2/3), color = "DeepPink", thickness = 3, linestyle = solid):

Tr := p->plottools[rotate](p, (1/4)*Pi, [[0, 0, 0], [0, 0, 1]]):

Pr := plottools[polygon]([seq([2*cos((1/4)*Pi*k), 2*sin((1/4)*Pi*k), 0], k = 0 .. 8)], color = grey, style = surface):

A := plot3d(sqrt(-x^2-y^2+9), x = -2 .. 2, y = -P .. P, color = "HotPink", style = surface, scaling = constrained, axes = normal, numpoints = 5000, view = [-2.45 .. 2.45, -2.45 .. 2.45, 0 .. 3.45]):

C := plottools[cylinder]([0, 0, 1], 0.02, 2, style = surface, color = yellow): T := plots[tubeplot]({[0, 0, t, t = 0.7 .. 1], [0.2+0.2*cos(t), 0, 0.7-0.2*sin(t), t = 0 .. Pi]}, radius = 0.04, style = surface, color = brown):

plots[display](A, Pr, seq((Tr@@k)(F), k = 0 .. 7), C, T, axes = none);

 

                            

 

 Umbrella.mw

 

I did not find any command in Maple, which is plotting a vector field on a surface. But this is easy to do by hand, if you use plots[arrow]  command.

An example:

restart;

V := seq(seq(plots[arrow]([cos(phi)*sin(theta), sin(phi)*sin(theta), cos(theta)], [(1/5)*cos(phi)*cos(theta), (1/5)*sin(phi)*cos(theta), -(1/5)*sin(theta)], color = red), phi = 0 .. evalf(2*Pi), evalf(Pi/12)), theta = 0 .. evalf(Pi), evalf(Pi/12)):

S := plot3d(1, phi = 0 .. 2*Pi, theta = 0 .. Pi, style=surface, color = "LightBlue", coords = spherical):

plots[display](V, S, axes = normal, view = [-1.4 .. 1.4, -1.4 .. 1.4, -1.4 .. 1.4]);

 

                         

 

 

 We see that this vector field has singularities  at the poles.

 

You can just copy from Maple to Word. I think that this will be the easiest way.

Example:

plot3d(x^3-3*x*y^2, x = -1 .. 1, y = -1 .. 1, linestyle = solid);   # "Monkey" saddle

 

This is a screenshot of Word:

                 

a:=6*s*sqrt(9*s^2+32)+18*s^2+32:

S:=sqrt(9*s^2+32)=t:

a1:=simplify(algsubs(S^2, a)) assuming t>0;

subs(rhs(S)=lhs(S), factor(subs(-32=9*s^2-t^2, a1)));

                                        

 

 

 

If I understand the question, the slidable constants are some numerical parameters? If so, I have designated these parameters, as a, b, c. In the following examples spherical coordinates r, phi, theta were specified as some function of these parameters. 

This procedure plots down the appropriate space curve and AnimationOfCurve procedure animates this curve.

Curve := proc(Range, a, b, c)  # Range is the range for t

local R, Phi, Theta;

R:=r(t,a,b,c); Phi:=phi(t,a,b,c); Theta := theta(t,a,b,c); plots:-spacecurve([R*cos(Phi)*sin(Theta), R*sin(Phi)*sin(Theta), R*cos(Theta)], t = Range, color = red, thickness = 2, linestyle = solid, axes = normal, orientation = [10, 50]);

end proc:

 

AnimationOfCurve := proc(Range, a, b, c)

local R, Phi, Theta;

R := r(t, a, b, c); Phi := phi(t, a, b, c); Theta := theta(t, a, b, c); plots:-animate(plots:-spacecurve, [[R*cos(Phi)*sin(Theta), R*sin(Phi)*sin(Theta), R*cos(Theta)], t = lhs(Range) .. lhs(Range)+s, color = red, thickness = 2, linestyle = solid, axes = normal], s = 0 .. rhs(Range)-lhs(Range), frames = 90, orientation = [10, 50]);

end proc:

 

 

Examples of use:

r := (t, a, b, c)->a*cos(t)+b*sin(t)+c:

phi := (t, a, b, c)->a^2*cos(t)+(b-1)*sin(t)+c+1:

theta := (t, a, b, c)->a^3*cos(t)+(b^2-1)*sin(t)+c^2+1:

Curve(0..2*Pi,1,2,3);

                                      

 

AnimationOfCurve(0..2*Pi,1,2,3);

                                      

 

 

 

nombor1:=[4,6,2];

n:=nops(nombor1);

add(nombor1[i]*10^(n-i), i=1..n);

                                            

 

Addition:  The method is general in nature and can easily be written in the form of a procedure.

 

 

First 190 191 192 193 194 195 196 Last Page 192 of 289