749 Reputation

11 years, 88 days

can maple compute right and left eigenve...

Maple

Hi. Can maple compute right and left eigenvectors of a matrix?

Maple

any way to get two equations solved...

Maple

i have two euations including integration which has two unkwnon x1 and x2.
how can i get these equations solved, thanks for the help.

 > restart:
 > with(DirectSearch)
 (1)
 > with(LinearAlgebra):
 > with(Student:-Calculus1):
 > with(Student:-NumericalAnalysis):
 > A:=convert(taylor(exp(Q),Q,6),polynom);
 (2)
 > Q:=a[11]*(E[r])^2+a[22]*(E[theta])^2+2*a[12]*E[r]*E[theta];
 (3)
 > psi:=0.5*c*(exp(Q)-1);
 (4)
 > F:=Matrix(3,3,[[lambda[r],0,0],[0,lambda[theta],0],[0,0,lambda[z]]]);
 (5)
 > sigma[r]:=-p+diff(psi,E[r])*F[1,1]^2;
 (6)
 > sigma[theta]:=-p+diff(psi,E[theta])*F[2,2]^2;
 (7)
 > sigma[z]:=-p+diff(psi,E[z])*F[3,3]^2;
 (8)
 > p1:=diff(psi,E[r])*F[1,1]^2;#Pressure is constituted form 3 parts, one part is p1, other part is p2 and a constant p0
 (9)
 > E[r]:=0.5*(lambda[r]^2-1);
 (10)
 > E[theta]:=0.5*(lambda[theta]^2-1);
 (11)
 > E[z]:=0.5*(lambda[z]^2-1);
 (12)
 > lambda[r]:=x2*sqrt((r^2-x1)/x2)/r;
 (13)
 > lambda[theta]:=r/sqrt((r^2-x1)/x2);
 (14)
 > lambda[z]:=1/x2;
 (15)
 > sigma[r];
 (16)
 > sigma[theta]:
 > sigma[z]:
 > #p2:=int((sigma[r]-sigma[theta])/r,r):%Pressure is constituted form 2 parts, one part is p1, other part is p2 and and a constant p0
 > Digits:=10:
 > c:=790000:
 > a[11]:=0.539:
 > a[22]:=0.368:
 > a[12]:=0.653:
 > p_in:=10000:
 > p_out:=0:
 > r_in:=5.4e-3:
 > r_out:=6.1e-3:
 > F_a:=0.381846:
 > p21:=(c/2)*(((r^2-x1)/r^3)-(x2*r/(r^2-x1)))*exp(Q);
 (17)
 > p22:=(c/2)*Int(exp(Q)*(3*x2*r^6-r^6+5*x1*r^4-x1*x2*r^4-7*x1^2*r^2+3*x1^3)/(r^4*(r^2-x1)^2),r=r_in..r_out);#This is the part that should be maintained as an integral until the final solution
 (18)
 > p2:=p21-p22;#p2 is computed using the integration by part method
 (19)
 >
 > p0:=(p_out+eval(p2,r=r_out));#p0 is the constant which is defined form the boundary conditions either p_out=subs(r=r_out,sigma[r]) or p_in=subs(r=r_in,sigma[r])
 (20)
 >
 > p:=p1+p2+p0;#p is the total pressure
 (21)
 > #p:=H+H00;
 > eq1:=Int((sigma[r]-sigma[theta])/r,r=r_in..r_out);
 (22)
 > eq2:=Int(2*Pi*sigma[z]*r,r=r_in..r_out);
 (23)
 > eq1=evalf(p_out-p_in)
 (24)
 > eq2=F_a
 (25)
 > fsolve({eq1=evalf(p_out-p_in),eq2=F_a},{x1,x2});
 (26)
 > SolveEquations([eq1=evalf(p_out-p_in),eq2=F_a]);
 >
 >
 >

fsolve_problem.mw

select terms with sum of powers equal to...

Maple

Hi. i want to select terms with sum of powers equal to 1 and other terms with sum of powers more than 1 for the following equation.

 > restart
 > eq:=-2.*10^(-12)*p[1](t)*q[1](t) + 7.133360604*10^(-8)*p[1](t)*q[0](t) + 2.839877758*10^(-7)*q[0](t)*p[2](t) + p[0](t)*q[0](t) + p[0](t)^2 + q[0](t)^3 + p[1](t) + 8*q[4](t)
 (1)
 >
 >

actually i need an algorithm to select linear terms from nonlinear ones(sum of powers equals to more than one) and vice versa.

create a list of 0 and 1 numbers with so...

Maple

Hi. i want to create a list of n random 0 and 1 numbers with x numbers equal to 1 and n-x number equal to zero.
for example in the code below, i have produced n=100 numbers of 0 and 1. But i want to create a proc that takes x as an input and generates this list with specified number of x numbers 1 and n-x numbers zero randomly. thanks for the help

 > restart:with(RandomTools):
 > n:=100
 (1)
 > A:=[seq](Generate(choose({0, 1})),i=1..n)
 (2)
 >
 >
 >