pik1432

245 Reputation

6 Badges

6 years, 123 days

MaplePrimes Activity


These are questions asked by pik1432

Hello all, 

Would you tell me how to replace a part of an equation with another expression?

I tried to replace the expression '(1-Lm^2/(Ls*Lr))' in the equation below ('LD') with an expression 'sigma', but no success. 

restart;

LD := Lambda_ds = (-Lm^2/Lr + Ls)*i_ds + Lm*Lambda_dr/Lr;

Lambda_ds = (-Lm^2/Lr+Ls)*i_ds+Lm*Lambda_dr/Lr

(1)

sigma := (1-Lm^2/(Ls*Lr));

1-Lm^2/(Ls*Lr)

(2)

algsubs(1-Lm^2/(Ls*Lr)=ss,LD);

Lambda_ds = (-Lm^2/Lr+Ls)*i_ds+Lm*Lambda_dr/Lr

(3)

subs({(1-Lm^2/(Ls*Lr)) = sigma}, (3));

Lambda_ds = (-Lm^2/Lr+Ls)*i_ds+Lm*Lambda_dr/Lr

(4)

 


 

Download question20200618.mw

Hello there, 

When I tried to solve a set of equations, represented in a matrix form, Maple complained. After the matrix form was decomposed to row by row and solve was attempted, Maple became happy. I wonder if I can solve the set of equations in a matrix form. 


 

Goal: solve this set of equations in terms of Xl12/Xl23/Xl13

X1 = 0.5 * ( Xl12 + Xl13 - Xl23 )
X2 = 0.5 * ( Xl12 + Xl23 - Xl13 )
X3 = 0.5 * ( Xl13 + Xl23 - Xl12 )

X:=<X1, X2, X3>;

Vector(3, {(1) = X1, (2) = X2, (3) = X3})

(1)

Xeq:= X = <1/2*(xl12 + xl13-xl23), 1/2*(xl12 + xl23-xl13), 1/2*(xl13 + xl23-xl12)>;

(Vector(3, {(1) = X1, (2) = X2, (3) = X3})) = (Vector(3, {(1) = (1/2)*xl12+(1/2)*xl13-(1/2)*xl23, (2) = (1/2)*xl12+(1/2)*xl23-(1/2)*xl13, (3) = (1/2)*xl13+(1/2)*xl23-(1/2)*xl12}))

(2)

solve(Xeq, {xl12, xl13, xl23});

Error, invalid input: solve expects its 1st argument, eqs, to be of type {`and`, `not`, `or`, algebraic, relation(algebraic), ({list, set})({`and`, `not`, `or`, algebraic, relation(algebraic)})}, but received (Vector(3, {(1) = X1, (2) = X2, (3) = X3})) = (Vector(3, {(1) = (1/2)*xl12+(1/2)*xl13-(1/2)*xl23, (2) = (1/2)*xl12+(1/2)*xl23-(1/2)*xl13, (3) = (1/2)*xl13+(1/2)*xl23-(1/2)*xl12}))

 

Did not work.

solve({X1=1/2*(xl12 + xl13-xl23), X2=1/2*(xl12 + xl23-xl13), X3=1/2*(xl13 + xl23-xl12)}, {xl12, xl13, xl23});

{xl12 = X1+X2, xl13 = X3+X1, xl23 = X2+X3}

(3)

Did work.

 


 

Download Q_20200609.mw

This is a given set of equations (from a classifier problem in deep learning):

I tried to replicate the expression in Maple, but it was unsuccessful. 

Q_MaplePrime20200417.mw

Would you tell me how to make it work?

Then, please let me know how to refer to a previous result (equation number) in the current expression. 

The last line above (and the attached Maple document) shows my attempt, It did not work. 

Thank you/Be healthy!

 

 

When I tried to copy any of the expression among (1) and (4), the only MathML string appearing at the target application is this:

<math xmlns='http://www.w3.org/1998/Math/MathML'></math>

 


 

restart:

n:= 2:

X:= Vector(n, symbol= x);

Vector(2, {(1) = x[1], (2) = x[2]})

(1)

W:= Matrix(3,2, symbol= w);

Matrix(3, 2, {(1, 1) = w[1, 1], (1, 2) = w[1, 2], (2, 1) = w[2, 1], (2, 2) = w[2, 2], (3, 1) = w[3, 1], (3, 2) = w[3, 2]})

(2)

V:= W.X;

Vector(3, {(1) = w[1, 1]*x[1]+w[1, 2]*x[2], (2) = w[2, 1]*x[1]+w[2, 2]*x[2], (3) = w[3, 1]*x[1]+w[3, 2]*x[2]})

(3)

answer:=seq(diff~(v,W), v= V);

answer := Matrix(3, 2, {(1, 1) = x[1], (1, 2) = x[2], (2, 1) = 0, (2, 2) = 0, (3, 1) = 0, (3, 2) = 0}), Matrix(3, 2, {(1, 1) = 0, (1, 2) = 0, (2, 1) = x[1], (2, 2) = x[2], (3, 1) = 0, (3, 2) = 0}), Matrix(3, 2, {(1, 1) = 0, (1, 2) = 0, (2, 1) = 0, (2, 2) = 0, (3, 1) = x[1], (3, 2) = x[2]})

(4)

 


Can you tel me how to fix this error?

Download question1a.mw

Dear all, 

I did these commands in Maple:

restart:
x:=Matrix([[x1],[x2]])

W:=<<w11 | w12>, <w21 | w22>>

v:= (W.x)

<seq(diff(v,t),t=W)>;

Then, the answer was this:

Vector[column](8, [x1, 0, 0, x1, x2, 0, 0, x2])

What I expected was this:

Would you tell me how to map or reorder the calculation result from Maple?

Thank you

question.mw

First 8 9 10 11 12 Page 10 of 12