May 14, 2010 #1 Bossebo Structural Joined May 12, 2010 Messages 5 Location SE Hi I realy searched in mathcad help for this one but cant find it. I would like mathcad to do this: f(x)=a+b if a>0 and b>0 i know how to do it with just one condition but how do i get it to check both if a>0 and b>0 ??
Hi I realy searched in mathcad help for this one but cant find it. I would like mathcad to do this: f(x)=a+b if a>0 and b>0 i know how to do it with just one condition but how do i get it to check both if a>0 and b>0 ??
May 14, 2010 #2 IRstuff Aerospace Joined Jun 3, 2002 Messages 44,895 Location US Did you search for Boolean Operators? TTFN FAQ731-376 Upvote 0 Downvote
May 14, 2010 #3 Occupant Mechanical Joined Dec 8, 2006 Messages 355 Location US I don't quite understand what you really want, but the attached should at least get you going, Of course, only the firt case really counts, I added the others to play through all possibilities. http://files.engineering.com/getfile.aspx?folder=aa9c9230-db40-4475-933c-4b225a21a35e&file=In_Line_IF.jpg Upvote 0 Downvote
I don't quite understand what you really want, but the attached should at least get you going, Of course, only the firt case really counts, I added the others to play through all possibilities.
May 14, 2010 Thread starter #4 Bossebo Structural Joined May 12, 2010 Messages 5 Location SE Sorry but my english is quite bad. I know how to do this: f= a+b if a>0 a-b otherwise witch in words meens that matchad check wether a is bigger than 0 and the set f=a+b. if a should happen to be smaler than 0 it set f to a-b. Now i want mathcad to check wether both a and b is bigger than 0 and then set f=a+b otherwice f should be a-b. I thought something like this would work: f=a+b if a>0,b>0 a-b otherwise but it dident. I simply want to write an if...and..then... formula Do I make myself clear? Upvote 0 Downvote
Sorry but my english is quite bad. I know how to do this: f= a+b if a>0 a-b otherwise witch in words meens that matchad check wether a is bigger than 0 and the set f=a+b. if a should happen to be smaler than 0 it set f to a-b. Now i want mathcad to check wether both a and b is bigger than 0 and then set f=a+b otherwice f should be a-b. I thought something like this would work: f=a+b if a>0,b>0 a-b otherwise but it dident. I simply want to write an if...and..then... formula Do I make myself clear?
May 14, 2010 #5 IRstuff Aerospace Joined Jun 3, 2002 Messages 44,895 Location US This is not a question of English, but of math, and you already wrote the form of the equation in your original posting: if((a>0)^(b>0),a+b,"not valid") TTFN FAQ731-376 Upvote 0 Downvote
This is not a question of English, but of math, and you already wrote the form of the equation in your original posting: if((a>0)^(b>0),a+b,"not valid") TTFN FAQ731-376
May 16, 2010 #6 jghrist Electrical Joined Jul 16, 2002 Messages 4,226 Location US f:=if((a>0)*(b>0),a+b,a-b) Upvote 0 Downvote
May 16, 2010 #7 PNachtwey Electrical Joined Oct 9, 2004 Messages 779 Location US I have an example that shows how to use the 'and' or '^' operator http://www.deltamotion.com/peter/Mathcad/Mathcad - t2p1 JCH cascade simple.pdfsee page 5/15. Peter Nachtwey Delta Computer Systems http://www.deltamotion.com Upvote 0 Downvote
I have an example that shows how to use the 'and' or '^' operator http://www.deltamotion.com/peter/Mathcad/Mathcad - t2p1 JCH cascade simple.pdfsee page 5/15. Peter Nachtwey Delta Computer Systems http://www.deltamotion.com
May 16, 2010 Thread starter #8 Bossebo Structural Joined May 12, 2010 Messages 5 Location SE Thanks everyone. I searched for boolean and found out how to do! Upvote 0 Downvote