Kitonum

21550 Reputation

26 Badges

17 years, 123 days

MaplePrimes Activity


These are answers submitted by Kitonum

Let diagonally for  i=3 .. m+3  as in your example are the same numbers (elements of the list  L ).

Matr1 := proc(m, L) 

local s;

s := {seq(seq((i, j) = L[j-i+3], j = i-2..i+2), i = 3 .. m+3), (1, 2) = 1, (1, 3) = 4, (1, 4) = 1, (2, 2) = -1, (2, 4) = 1, (m+4, m+2) = -1, (m+4, m+4) = 1, (m+5, m+2) = 1, (m+5, m+3) = 4, (m+5, m+4) = 1};

Matrix(m+5, s);

end proc:

Example for  m=5:

Matr1(5, [6, 2*x, 3, 4, 9]);

 

 

According to the problem, the roots must be different. The result may be easily verified graphically. And the initial problem itself also can be solved graphically.

sol:=[m, -3*m+2, -m-3, 2*m+1]:

solve({max(sol) > 0, mul(j, j = sol) > 0, sol[1] <> sol[2], sol[1] <> sol[4], sol[3] <> sol[2], sol[3] <> sol[4], min(sol) < 0}, m);

plot([m, -3*m+2, -m-3, 2*m+1], m = -5 .. 5, -8 .. 10, color = [red, blue, green, yellow], thickness=2);

 

 

You seem to have missed the element  a[4,2] .

The procedure  Matr  solves your problem, for any  m>=0 .

Matr := proc(m)

local s;

s := {seq(seq((i, j) = a[j-3, i-3], j = i-2 .. i+2), i = 3 .. m+3), (1, 2) = 1, (1, 3) = 4, (1, 4) = 1, (2, 2) = -1, (2, 4) = 1, (m+4, m+2) = -1, (m+4, m+4) = 1, (m+5, m+2) = 1, (m+5, m+3) = 4, (m+5, m+4) = 1};

Matrix(m+5, s);

end proc:

 

Your example:

Matr(3);

 

Another example:

interface(rtablesize=20):
Matr(7);

 

 

 

Use the command  Student[VectorCalculus][LineInt]

An example:

 

A:=plot(sin(x), color=red,legend="Sin"):

B:=plot(cos(x), color=blue, legend="Cos"):

C:=plot(tan(x), color=green, legend="Tan", discont=true):

E:=plot([seq([Pi/2+Pi*k, t, t=-3..3], k=-1..2)],color=black, linestyle=2, legend=["Asymptote"$4]):

plots[display](A,B,C,E, thickness=2,view=[-Pi/2..5*Pi/2, -3..3], scaling=constrained);

 

Corrections in the last line and result:

plots[implicitplot]('IC(2, x, y, 1, 1)', x = .1 .. .9, y = -1 .. 1, filled = true, numpoints = 10);

#  or  plots[implicitplot]((x,y)-> IC(2, x, y, 1, 1), .1 .. .9, -1 .. 1, filled = true, numpoints = 10);

 

x := 5.180070098;

y := -8.852276351;

k := 10.25650636;

 f := s->piecewise(0 < s and s <= 2, (1+I*k/y)*((1+I*k/x)*exp(I*x*s)/(1-I*k/x)+exp(-I*x*s))/(1-I*k/y), 2 < s and s <= 5, exp(-(2*I)*x)*((1+I*k/y)*exp(I*y*(s-2))/(1-I*k/y)+exp(-I*y*(s-2))), 5 < s and s <= 7, exp(-(3*I)*y)*((1+I*k/x)*exp(I*x*(7-s))/(1-I*k/x)+exp(-I*x*(7-s))), 7 < s and s <= 10, (1+I*k/x)*((1+I*k/y)*exp(I*y*(10-s))/(1-I*k/y)+exp(-I*y*(10-s)))/(1-I*k/x)):

a := s->abs(f(s));

 plot(a, 0..10, discont = true);   #  or  plot('a(s)', s=0..10, discont = true);

Simplify your code, your functions  f  and  g  are the same. The plotting was done on separate points with step= 0.01.

x := 5.180070098;

y := -8.852276351;

k := 10.25650636;

 f := s->piecewise(0 < s and s <= 2, (1+I*k/y)*((1+I*k/x)*exp(I*x*s)/(1-I*k/x)+exp(-I*x*s))/(1-I*k/y), 2 < s and s <= 5, exp(-(2*I)*x)*((1+I*k/y)*exp(I*y*(s-2))/(1-I*k/y)+exp(-I*y*(s-2))), 5 < s and s <= 7, exp(-(3*I)*y)*((1+I*k/x)*exp(I*x*(7-s))/(1-I*k/x)+exp(-I*x*(7-s))), 7 < s and s <= 10, (1+I*k/x)*((1+I*k/y)*exp(I*y*(10-s))/(1-I*k/y)+exp(-I*y*(10-s)))/(1-I*k/x)):

a := s->abs(f(s));

X := [seq(s, s = 0 .. 10, 0.01)]:

Y := [seq(a(s), s = 0 .. 10, 0.01)]:

 plot(X, Y, discont = true);

 

 

with(combinat):

L:=[1,2,3]:

L1:=permute(L, 1);

L2:=permute(L, 2);

L3:=permute(L, 3);

M:=[]:

for i in L3 do

for j in L2 do

for k in L1 do

M:=[op(M), [i,j,k]]:

od: od: od:

nops(M); op(M);

 

 

In the example I used the same matrices as Markiyan:

with(LinearAlgebra):

A:=Matrix([[-93, -72], [-76, -2]]):

C:=Matrix([[-98, 57], [-77, 27]]):

E:=Matrix([[-38, 87], [-18, 33]]):

Id:=IdentityMatrix(2):

fsolve(Determinant(A-lambda*C.Id-lambda^2*E.Id), lambda,complex);

           -11.36829371, -.3123524009-1.257844764*I, -.3123524009+1.257844764*I, .8872292854

The next version works:

restart;
for a from 0 to 10 do
A := Matrix([[a, 0], [0, 0]]):
if LinearAlgebra[Equal](A^2, A) then print(a, A) end if;
end do:

r:=[a,b,c]:

[seq(lambda-r[i]^2, i=1..3)];

I assumed that the sign of inequality is >= 0. The following simple procedure solves your problem.

P:=proc(alpha, beta)

if beta=-1 then error "0 in denominator" fi;

if alpha=0 then {k>0} else allvalues(solve({alpha*beta*(1-alpha)*k^(alpha-1)/(1+beta)-1-(2*alpha-1)*alpha*(1-alpha)*beta*k^(2*(alpha-1))/(1+beta)+alpha^2*k^(alpha-1)>=0, k>=0}, k))  fi;

end proc:

Examples:

P(1/2, 3),  P(7, 1/2),  P(3, 5),  P(1, 3);

 

 

M. Hirnyk!
Of course, the eliminate command is not always able to find an explicit equation relating B and A. In this case, the problem can be solved numerically by the following scheme (the simplest way):

1) Construct the plot of the function  B(t)  and on it we find the range in which the function is monotonic.
2) For each value of  B  through some step find the corresponding value of t .

3) Substitute these  t in A (t) .
4) Using these lists we build the plot A (B) .

Solution for your example:

plot(t^5-sin(t)-2, t=0..2, labels=[t,B]);

T:=[seq(fsolve(B = t^5-sin(t)-2, t=0.63..2), B=-2.4..29, 0.1)];

X:=[seq(B, B=-2.4..29, 0.1)];
Y:=[seq(eval( t^3-exp(t)), t in T)];

plot(X, Y, labels=[B,A]);

 

 

You have 2 functions  A=A(t)  and B=B(t) .To plot A in terms of B you should to eliminate the variable  t

An example:

F := eliminate({A = t^3-t, B = t^3-t^2}, t);

plots[implicitplot](op(F[2]), B = -1 .. 1, A = -1 .. 1, scaling = constrained, numpoints = 50000);

 

 

First 264 265 266 267 268 269 270 Last Page 266 of 290