Kitonum

14778 Reputation

24 Badges

11 years, 324 days

MaplePrimes Activity


These are answers submitted by Kitonum

To solve these problems, use Mathematica rather than Maple:

Reduce[{0 < 2*f[1], 5 < f[1] + f[2], 8 < f[1] + f[3], 
f[1] + f[4] == 7, 0 < 2*f[2], f[2] + f[3] == 6, 6 < f[2] + f[4],
0 < 2*f[3], 11/2 < f[3] + f[4], 0 < 2*f[4]}, {f[1], f[2], f[3],
f[4]}]

                                         False 

The solution will be correct, if we write

solve({ a + b = 1, a > 0, b > 1/2}, {a,b,c})  assuming  c>0;

               {a = -b+1, c = c, 1/2 < b, b < 1}

Numbers  (-1) ^ (1/2 ) ,  (-1) ^ (3/2)  and so on - are some complex numbers. If you want them to have remained in that state, and not calculated to form  a+I*b (I - complex unit), you can write like this

sum(-y2*y3+8*(-1)^``((k-1)*(1/2))*sinh(y2*Pi*k)*sin(k*Pi*y3)/(Pi^3*k^3*cosh((1/2)*k*Pi)), k = 1 .. 10);

 

{p2=0.00251}, {p2=1.59454}: 

assign(op(%[1])):

p2;

           0.00251

You can plot the indefinite integral:

M:=10^8:
plot(int(x^2*exp(Pi*x/10^12*M), x), x = 0 .. 1000);

To better compare the graphics,  scaling=constrained option is used and the range on vertical axis is limited.

V:=(2*x^2+2*y+gamma)*y^3:

a0:=subs(x=0.9,gamma=0,V):

a1:=subs(x=0.9,gamma=2,V):

a2:=subs(x=0.9,gamma=4,V):

 

b0:=subs(x=0.1,gamma=0,V):

b1:=subs(x=0.1,gamma=2,V):

b2:=subs(x=0.1,gamma=4,V):

 

A:=plot([a0,a1,a2], y = 0 .. 1, 0..5, linestyle = [dot, dash,dot], color = [red, blue,green]): 

B:=plot([b0,b1,b2], y = 0 .. 2, 0..5, linestyle = [dot, dash,dot], color = [red, blue,green]):

 

plots[display](< display(A) | display(B) >, scaling=constrained);

a1:=plot(x^2,x=1..2): a2:=plot(x^2,x=3..4): a3:=plot(x^2,x=4..5):

b1:=plot(x^3,x=1..2): b2:=plot(x^4,x=1..2): b3:=plot(x^5,x=1..2):

a:=a1,a2,a3:  b:=b1,b2,b3:

A:=Vector([a]):

B:=Vector([b]):

with(plots):

display(< A|B >);

display(LinearAlgebra[Transpose](< A|B >));

P:=proc(L::list)

local M, F, Max, S, i;

M:=convert(L, set);

F:=[seq([M[i], ListTools[Occurrences](M[i], L)], i=1..nops(M))];

print(F);

Max:=max(seq(F[i, 2], i=1..nops(M)));

S:=[];

for i in F do

if i[2]=Max then S:=[op(S), i[1]]; fi;

od;

op(S);

end proc: 

 

Example:

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

P(L);

      [[1, 1], [2, 1], [3, 13], [4, 4]]

                       3


What means your dual equality? The system of equations? If  only the first equation is acceptable and from the boundary conditions to retain only the first two, Maple finds the only one trivial solution. Assuming that Maple was right,  the initial boundary value problem has no solution.

dsolve({(diff(f(x), x))^2-f(x)*(diff(f(x), x, x)) = diff(f(x), x, x, x)-100*(diff(f(x), x))-0.001*(2*(diff(f(x), x))*(diff(f(x), x, x, x))-f(x)*(diff(f(x), x, x, x, x))-(diff(f(x), x, x))^2), f(0) = 0, ((D@@2)(f))(0) = 0}, f(x));

                                                                        f(x)=0

It is easy to prove that there are no such triangles in the plane. In space there are infinitely many such triangles. The smallest will be (3, 0, 0), (0, 3, 0), (0, 0, 3) . Its easy to find a simple search.

PS. It can be found without brute force if you know that in any cube, there are 3 vertices of the cube, forming an equilateral triangle.

A:=plot(sin(x), x=-Pi..Pi, color=red):
B:=plot(cos(x), x=-Pi..Pi, color=blue):

plots[display](Array([A, B]));

I think that we should not trust to the symbolic solutions of the equations with the parameters obtained with Maple. Here are two simple examples.

with(RealDomain):

solve(sqrt(x-a)=x, x);

solve(a*x^2-2*x+4=0, x);

Both answers are incorrect. The first equation has two solutions only in the range  0 <=a< 1/4 . For other values ​​of the parameter  a  there are no solutions or only one solution. This is easily seen by constructing graphs. 

The solution of the second equation is correct only for  a<>0  and  a<=1/4 .

Both equations can be correctly solved in the package Mathematica. Here, for example, the first example:

Your equation  3a(1+z)^2=2(a(1+z)^3+b)^(1/2)  with two parameters  a  and  b  is much more complex. You can correctly and  explicitly solve it in Mathematica by using commands

ToRadicals[
Reduce[3*a*(1 + z)^2 == 2*(a*(1 + z)^3 + b)^(1/2), z, Reals]]
The output is very cumbersome.

f:= A^2-2*sqrt(A^2+1)+1;

f2:= simplify(algsubs(A^2+1 = M^2,  f)) assuming M>0;

             f := A^2-2*(A^2+1)^(1/2)+1

                     f2 := M^2-2*M

The procedure Routes finds all the routes with a travel length of n in a NxN square and the number of such routes.

Routes:=proc(N::posint, n::nonnegint)

local L, Rule; global T;

if n>=N^2 then T:=[]: print(0);   else

L:=[seq(seq([[i, j]], j=1..N), i=1..N)];

 

Rule:=proc(K)  # Continuation of the route by 1 step

local S, k, M, r, p;

S:=[ ]; k:=nops(K[1]);

for r in K do

M:=[ ]:

if r[k]=[1, 1] then for p in [[1, 2], [2, 2], [2, 1]] do  # Bottom left corner

if convert([seq(r[i]<>p, i=1..k-1)], `and`) then M:=[op(M),[op(r), p]]: fi:

od:

S:=[op(S), op(M)]: fi:

if r[k]=[1, N] then for p in [[1, N-1], [2, N-1], [2, N]] do  # Top left corner

if convert([seq(r[i]<>p, i=1..k-1)], `and`) then M:=[op(M),[op(r), p]]: fi:

od:

S:=[op(S), op(M)]: fi:

if r[k]=[N, N] then for p in [[N-1, N], [N-1, N-1], [N, N-1]] do  # Top right corner

if convert([seq(r[i]<>p, i=1..k-1)], `and`) then M:=[op(M),[op(r), p]]: fi:

od:

S:=[op(S), op(M)]: fi:

if r[k]=[N, 1] then for p in [[N-1, 1], [N-1, 2], [N, 2]] do  # Bottom right corner

if convert([seq(r[i]<>p, i=1..k-1)], `and`) then M:=[op(M),[op(r), p]]: fi:

od:

S:=[op(S), op(M)]: fi:

if r[k,1]=1 and r[k,2]<>1 and r[k,2]<>N then for p in [[1, r[k,2]-1], [2, r[k,2]-1], [2, r[k,2]-1], [2, r[k,2]+1], [1, r[k,2]+1]] do                      # Left side

if convert([seq(r[i]<>p, i=1..k-1)], `and`) then M:=[op(M),[op(r), p]]: fi:

od:

S:=[op(S), op(M)]: fi:

if r[k,2]=N and r[k,1]<>1 and r[k,1]<>N then for p in [[r[k,1]-1, N], [r[k,1]-1, N-1], [r[k,1], N-1], [r[k,1]+1, N-1], [r[k,1]+1, N]] do                    # Top side

if convert([seq(r[i]<>p, i=1..k-1)], `and`) then M:=[op(M),[op(r), p]]: fi:

od:

S:=[op(S), op(M)]: fi:

if r[k,1]=N and r[k,2]<>1 and r[k,2]<>N then for p in [[N, r[k,2]+1], [N-1, r[k,2]+1], [N-1, r[k,2]], [N-1, r[k,2]-1], [N, r[k,2]-1]] do                    # Right side

if convert([seq(r[i]<>p, i=1..k-1)], `and`) then M:=[op(M),[op(r), p]]: fi:

od:

S:=[op(S), op(M)]: fi:

if r[k,2]=1 and r[k,1]<>1 and r[k,1]<>N then for p in [[r[k,1]-1, 1], [r[k,1]-1, 2], [r[k,1], 2], [r[k,1]+1, 2], [r[k,1]+1, 1]] do                    # Bottom side

if convert([seq(r[i]<>p, i=1..k-1)], `and`) then M:=[op(M),[op(r), p]]: fi:

od:

S:=[op(S), op(M)]: fi:

if r[k,1]<>1 and r[k,1]<>N and r[k,2]<>1 and r[k,2]<>N then for p in [[r[k,1]-1, r[k,2]-1], [r[k,1]-1, r[k,2]], [r[k,1]-1, r[k,2]+1], [r[k,1], r[k,2]+1], [r[k,1]+1, r[k,2]+1], [r[k,1]+1, r[k,2]], [r[k,1]+1, r[k,2]-1], [r[k,1], r[k,2]-1]] do  # Inside

if convert([seq(r[i]<>p, i=1..k-1)], `and`) then M:=[op(M),[op(r), p]]: fi:

od:

S:=[op(S), op(M)]: fi:

od;

S;

end proc;

 

T:=(Rule@@n)(L);  # List of all the routes

nops(T);  # Number of all the routes

fi;

 

end proc;


Example:

Routes(4, 6);

T[10000]; T[20000]; T[60000];

 

See http://www.mapleprimes.com/questions/142417-Generating-Matrix-Code

First 211 212 213 214 215 216 217 Last Page 213 of 231