cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Issues with Solve Block

Johnruehlz
7-Bedrock

Issues with Solve Block

I'm trying to set up a solve block so I can call it as a function. In the this case it will find what cable size matches the manufacturers specifications and return the subscript for which it is at. But it keeps telling me that the variable is undefined. Can you explain what I'm doing wrong here?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

 

You have the wrong equal sign.

Capture.JPGCapture2.JPG

You need to change the if blocks to use otherwise statements, as Luc has pointed out you always get 5

View solution in original post

10 REPLIES 10
ppal
17-Peridot
(To:Johnruehlz)

What solve block?

 

How about now as per attached?

Subs.png

LucMeekes
23-Emerald III
(To:ppal)

Subscription ALWAYS results in 5, due to the last statement of the program.

Luc

Hi,

 

You have the wrong equal sign.

Capture.JPGCapture2.JPG

You need to change the if blocks to use otherwise statements, as Luc has pointed out you always get 5

May be the built-in function match solves you problem

match.png

Sorry for ignorance. Could you explain a little more in detail with what I'm trying to accomplish? I'm trying to be able to use this to determine the correct set of manufacturer specifications for the given wire gauge, that needs to be used for the equation such as Rposseq,Xposseq,Rzeroseq, etc... that can use "i" to be able to shift through the equation to given all the answers for the table

Hi.

 

I hope my understanding is correct but here goes.

Your data is two tables. 

A circuit table that lists four circuits [0 - 3]

A cable table that lists five manufacturer's data [0 - 4]

Common to both tables is cable size column.

 

What you want to do is for each circuit look up the cable table in order to do some calculations for the circuit

In database terminology you are performing an query using both tables

This can be done with the match statement.

 

See enclosed file: index into cable table rows calculated from row x of curcuit table.

 

Capture.JPG

Instead of dealing with a lot of confusing nested if .. otherwise statements, thanks to the way "if" is implemented in Mathcad its sufficient to do as you already did and simply add one single otherwise statement at the and and return "out" as the last line.

Alternatively you could use one of the two following ways:

Bild.PNG

This doesn't really fix my issue, I can't seem to get rid of the error in the code block and I can't seem to use it as a function because of it, maybe I missed something but, I reloaded the files to see if maybe I did something wrong.

This solved my problem but, I used the equals sign on the keyboard any other time it works the correct way, weird.

The first time you use the "wrong" equal sign, Mathcad will default to the other; the subsequent use creates a strange effect:

wrong equals.PNG

Top Tags