Skip to main content
1-Visitor
December 1, 2021
Solved

Prime 7, programing "if" any of these values.

  • December 1, 2021
  • 2 replies
  • 4864 views

Greetings, im trying to program something that fills a matrix automatically, but you can choose wich rows and columns to make 0 instead.

 

So far i can do it by hand, just setting what row and colum i want (fil=row), and adding extra conditions to the "if" 

 

I tried to use a matrix instead, like row:=[1 2 3], so if i= any of those 3 values, it assign it 0, but it doesnt seem to work with a matrix, i wrote it something like "if i=fil1_i" (_i meaning subscript), but it doesnt compare it to the value on the matrix.

 

Im working with Power Flow equations, in this part i need to do a 2x2 matrix each space being a Jacobian matrix. Im trying to automate it, because this is with 2 "bars" so matrix are 2x2, but when its something like 6 bars i dont want to do everything by hand

 

111.JPG

Best answer by Werner_E

I am not absolutely sure what you are trying to achieve, but maybe this function could be of help:

Werner_E_0-1638442843991.png

 

Prime 6 sheet attached

 

2 replies

24-Ruby III
December 2, 2021

Please upload your Mathcad Prime worksheet.

Werner_E25-Diamond IAnswer
25-Diamond I
December 2, 2021

I am not absolutely sure what you are trying to achieve, but maybe this function could be of help:

Werner_E_0-1638442843991.png

 

Prime 6 sheet attached

 

24-Ruby III
December 2, 2021

There is no attachment in your message.

25-Diamond I
December 2, 2021

@VladimirN wrote:

There is no attachment in your message.


Ooops, tnx! I just fixed it.