Question about using if condition for a parameter evaluation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Question about using if condition for a parameter evaluation
Hi All, I have a question regarding using the if condition inside the "add line" block, would anyone help me about this?
My target is to assign a value to the parameter "c_calculated". If logic=1, I want to use an equation to calculate the variable "c_calculated". If logic=0, I want to assign a number "c_initial" to the variable "c_calculated" . However, it seems like Mathcad does not allow me to do it in the way showing below. Would anyone tell me what is wrong with this?
Thank you!
Solved! Go to Solution.
- Labels:
-
Other
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Mathcad complains that the results have different shapes.
in the 'if' line the result is an expression, a symbolic one.
In the 'otherwise'line the result is (most probably) a simple constant.
Mathcad 15 cannot deal with that.
Observing that you're dealing with symbolics, I've revisited your original problem with as result:
And with LOGIC=0 that becomes:
Maybe this approach works for you in Mathcad 15.
Success!
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
There are several ways to do what you want:
Success!
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi LucMeeks,
Thank you so much for your help! Would you advise me why I failed to get the result? This is an error message that shows up in my worksheet. Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Mathcad complains that the results have different shapes.
in the 'if' line the result is an expression, a symbolic one.
In the 'otherwise'line the result is (most probably) a simple constant.
Mathcad 15 cannot deal with that.
Observing that you're dealing with symbolics, I've revisited your original problem with as result:
And with LOGIC=0 that becomes:
Maybe this approach works for you in Mathcad 15.
Success!
Luc
