Issues with Solve Block
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
Solved! Go to Solution.
- Labels:
-
Other
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
You have the wrong equal sign.
You need to change the if blocks to use otherwise statements, as Luc has pointed out you always get 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
What solve block?
How about now as per attached?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
You have the wrong equal sign.
You need to change the if blocks to use otherwise statements, as Luc has pointed out you always get 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
May be the built-in function match solves you problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This solved my problem but, I used the equals sign on the keyboard any other time it works the correct way, weird.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The first time you use the "wrong" equal sign, Mathcad will default to the other; the subsequent use creates a strange effect:
