Kitonum

21855 Reputation

26 Badges

17 years, 237 days

MaplePrimes Activity


These are replies submitted by Kitonum

@Stephan   

1) See the help on  piecewise

2) Add the line

applyop(x -> lhs(x)/L < rhs(x)/L, {1,3}, Mf(xi));

Animation quality can be slightly improved:

PDE := diff(u(x, t), t$2) = diff(u(x, t), x$2):

IBCs := u(x, 0) = sin((1/2)*Pi*x)*exp(-x), (D[2](u))(x, 0) = 0, u(0, t) = 0, u(4, t) = 0:

Sol := pdsolve({PDE}, {IBCs}, numeric):

Sol:-animate(t = 0 .. 20, frames = 300, thickness = 2, numpoints = 3000, labels=[x, u(x, t)]);

  

@Markiyan Hirnyk  There are infinitely many matrices  A  and  B  satisfying the condition  A.B = C . This is seen from the direct solution:

restart;

C:=Matrix([[8, 2, -2], [2, 5, 4], [-2, 4, 5]]):

A:=Matrix(3,2, symbol=a):

B:=Matrix(2,3, symbol=b):

solve(Equate(A.B,C)):

assign(%):

'A'=A; 'B'=B;

simplify(B.A);

 

 

 

@Joe Riel  of siderals is  Equate(A.B, C)

@Markiyan Hirnyk   I think that this is a natural way to solve such problems.

@masoud moeini 

restart;

alias(z(t) = exp(t)+a+sqrt(exp(t)-a+b)):

A(t):=ln(z(t)):

diff(A(t), t);

 

 

 

@rlopez  Thank you for an elegant solution to the problem! I am amazed at your deep knowledge of the package.

@c4meleon 

Your loop does not make a single step, because  xnew-xold<0 . In addition, at each step, do nothing.

Corrected code:

restart:

 xold:=1.5:

 f:=x->tan(x)-x-1:

 divis:= evalf(subs(x=xold,f(x))/subs(x=xold,diff(f(x),x))):

 xnew:=xold-divis:

 dp:=7:

 while abs(xnew-xold)>5.0*10.0^(-(dp+1)) do

  divis:= evalf(subs(x=xnew,f(x))/subs(x=xnew,diff(f(x),x))):

  xold:=xnew: xnew:=xnew-divis:

od:

 xnew;

Your task is similar to the nonlinear programming problem  http://en.wikipedia.org/wiki/Nonlinear_programming . In Maple  these problems solves  Optimization  package. Give specific wording of your problem. 

@Markiyan Hirnyk  Read carefully my original question. Error does not appear immediately, and if second time to run the code with changing the parameters.

@Axel Vogt  I wrote that the error only occurs with repeated use of the procedure with modified  arguments. But if you run the procedure again with the same arguments (after error), the error disappears. Errors are the same in Maple 12 (classic) and M16 (standard).

@Markiyan Hirnyk  Your code does not work for an equilateral triangle, because in this case, O2 = O3. In general, the code is very cumbersome , because to find the point   O1, O2, O3  and  etc. you actually use the same calculations that can be replaced by a single procedure.

@Markiyan Hirnyk  In your code you have problems with  xC := 1/2:  yC := (1/2)*sqrt(3):

@Markiyan Hirnyk   It is not interesting. To prove just replace  a= ln(4)+sin(1)

@Markiyan Hirnyk  We must use the exact math! Replace  1.1  with  11/10 .

There is a more interesting case, when the code is not working. Try to find it!

First 109 110 111 112 113 114 115 Last Page 111 of 134