Kitonum

21440 Reputation

26 Badges

17 years, 36 days

MaplePrimes Activity


These are answers submitted by Kitonum

This is probably a bug. In the procedures  Student[Calculus1]:-ShowSolution  and  Student[Calculus1]:-IntTutor  symbol  s  is automatically set to the empty list. Therefore, instead of the symbol  s , use any other symbol, for example,  a, b, r  and so on.

lista:=[[1,10],[2,20],[3,30]]:

x, y:=seq(map(t->t[i], lista), i=1..2);

                                            x, y := [1, 2, 3], [10, 20, 30]

restart;

z:=x->diff(y(x),x,x)+sin(y(x)):

u:=diff(z(x),x):

v:=diff(z(x),x,x):

w:=diff(y(x),x$3)+diff(y(x),x$2):

sys:=subs({y(x)=a, diff(y(x),x)=b, diff(y(x),x$2)=c, diff(y(x),x$3)=d, diff(y(x),x$4)=0.1},{z(x)=0, u=0, v=0, w=-0.1});

fsolve(sys);

assign(%);

sol:=dsolve({z(x)=0,y(0)=a,D(y)(0)=b}, numeric);

plots[odeplot](sol,[x,y(x)],x=0..3, thickness=2,view=[-0.5..3,-5..0.5]);

 

 

Addition: Only one solution is found. In fact, the original equation has four real solutions because the system  sys  has four real solutions  A:

restart;

sys := {c+sin(a) = 0, d+c = -0.1, d+cos(a)*b = 0, 0.1-sin(a)*b^2+cos(a)*c = 0};

A:=RealDomain[solve](sys);

 

 

Second addition: In fact, the set of solutions of  sys  will be infinite. Solutions are found only when  -Pi <a <Pi. If  {a, b, c, d}  is a solition then   {a+2*Pi*k, b, c, d} (k is an integer) is also a solution.

 

Plotting in classic Maple 12. To improve the quality, I added 2 options:

 

f:=x->max(x^2, sqrt(abs(x)));

plot(f, -3..3, thickness=2, numpoints=5000);

 

 

Addition: if you write

f:=proc(x)

if x^2>sqrt(abs(x)) then x^2 else sqrt(abs(x)) fi;

end proc;

 

then result is the same.

 

for arbitrary Matrix:

MatrixToString:=proc(A::Matrix)

local m, n;

m, n:=op(A)[1..2];

convert(cat(seq(op(["(", seq(op([convert(A[i,j], string), ","]), j=1..n), ")", "=="]), i=1..m-1), op(["(", seq(op([convert(A[m,j], string), ","]), j=1..n), ")"])), string);

end proc:

 

Example:

A:=Matrix(4,5, [$1..20]);

MatrixToString(A);

 

 

 

plots[implicitplot]  with  gridrefine  option also gives a nice plot:

 

plots[implicitplot]([x^3-4*x=y, y^3-3*y=x], x=-4..4, y=-4..4, color=[red,blue], thickness=2, gridrefine=3);

 

 

You do not need a graphics command. In the range  t=-0.05..0.05  the equation for each value  t  has a unique solution for  , so  fsolve  command can be used:

data:=[seq([t, fsolve(t+sin(8*x^3*t)-x^3, x, maxsols=1)], t=-0.05..0.05, 0.001)];

plot(data, thickness=2);

 

P:=proc(n,x)

option remember;

simplify(((2*n-1)*x*P(n-1,x)-(n-1)*P(n-2,x))/n);

end proc:

 

P(0,x):=1:  P(1,x):=x:

P(6,x);

simplify(LegendreP(6,x));

 

 

testeq  command is not suitable for checking all the roots, you can use  eval  command.

Solution and check:

eqns := {x^3-4*x = y, y^3-4*y = x}:

vars := {x, y}:

solns := solve(eqns, vars, explicit):

solns1 := map(simplify, [solns]);  # Simplified solutions

seq(simplify(eval([lhs(eqns[1])-rhs(eqns[1]), lhs(eqns[2])-rhs(eqns[2])], solns1[i])), i = 1 .. 9); #Checking of all the solutions

You got the solutions in implicit form. Here is the complete list of the all solutions:

eqns := {x^3-4*x = y, y^3-4*y = x};
vars := {x, y};
solns := solve(eqns, vars);

map(allvalues, [solns]);

 

Example:

 

L := [1,2,3,4,3,4,4];

{ListTools[FindRepetitions](L)[]};  # repetitive elements

convert(L, set) minus %;  # unique elements

                                   L := [1, 2, 3, 4, 3, 4, 4]

                                                {3, 4}

                                                {1, 2}

 

Addition: With regard to the indices see  ListTools[Search]  and  ListTools[SearchAll]  commands

In menu  view  classic Maple 12 you can read   (and this works)  Zoom Factor-> 50%  ctrl+0,  75%  ctrl+1, and so on.

In standard this does not work.

I do not see any problems.

 

Example:

f:=x->piecewise(x<=-1,x^2-2, x>-1 and x<1,x, x>=1,-x^2+3);

plot(f, -2..2, thickness=2, discont, scaling=constrained);

 

 

 

P  procedure solves your problem.

 

restart; 

P:=proc(m::posint, n::posint) 

local roll, i, j, k, L, A;

roll:=rand(100..999);

for i to m do

for j to n do

k:=roll(); L:=convert(k,base,10);

if L[1]<>L[3] then A[i,j]:=`   ` else A[i,j]:=k fi;

od;  od;

Matrix(m,n, (i,j)->A[i,j]);

end proc:

 

Example of use:

interface(rtablesize=infinity):

P(14,20);

In standard Maple 12:

restart;

with(VectorCalculus):

SetCoordinates(cartesian[x, y, z]);

alias(u = u(t, x, y, z), v = v(t, x, y, z), w = w(t, x, y, z)); alias(eta = eta(t, x, y, z));

U := VectorField(`<,>`(u, v, w));

Divergence(U);

Jacobian(U);

map(Diff, U, t);

convert(%, Vector[row]);

 

 

First 221 222 223 224 225 226 227 Last Page 223 of 289