Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
Hello,
I solve a non linear system by making use of MathCaf and I store the results in a variable (let's call it "sotto").
There are some values of the parameters (a, b, c, d) for which there is not any solution of the system, therefore
MathCAD returns an error message (see attachment).
I would like to add an "if statement " to monitor when the solution of the system does not exist.
For example, if the system does not have solutions, the variable SOL=0, otherwise SOL=1.
Is there a way (a built-in variable ?) that tells me that the system is impossible to be solved?
Thank you
Kate
Hi,
please attach the worksheet (we can't dedicate ourselves to writing your file ... don't you think?).
There's no built-in variable, like you suggest. But you can check for errors.
Something like:
Success!
Luc
Can be simplified to
Hi,
Solved this way, it's almost ok ......
If you don't like the idea to write a function with a,b,c,d as arguments but rather would like to just use the defined values in the sheet, the following should do the job as demanded.
If a solution was found the variable SOL is 1 and the other searched for variables have their appropriate values.
If the system could not be solved, SOL is 0 and the variables are set to NaN ("Not a value").