Skip to main content
1-Visitor
October 17, 2020
Solved

'if' function on MathCAD

  • October 17, 2020
  • 1 reply
  • 9491 views

Hi everyone,

I did this project on Matlab so I'm not sure how it should be at MathCAD. I have 1 condition

 

Td(t) = if(t<theta,To,T*(t-theta).

 

My professor got the result from MathCAD, I'm not sure how do we use if function here?

 

I also attached the file in this post, the issue was occur at scenario 3.

 

Thank you so much again,

 

Best answer by Werner_E

You did not specify an initial condition for T.sf, so I used a random value (T.sf(0)=100°F).

Obviously you want it to change to T.sf(0)=120°F,

1 reply

23-Emerald I
October 17, 2020

You only show scenario 1.

 

But  the units for hc include capacitance instead of temperature: 

FredKohlhepp_0-1602951575197.png

Try  

FredKohlhepp_1-1602951768023.png

 

1-Visitor
October 17, 2020

Hello

I fixed that already. I think I attached the wrong file. 

 

Would you please help me to take a look again please?

 

Thank you so much

25-Diamond I
October 17, 2020

Your function T.d creates a unit mismatch and is incomplete.

For t=1 minute the result is a temperature but for t<1 minute the result is temperature times time and for t>1 minute there is no result defined:

Werner_E_0-1602952564175.png

BTW, what you wrote

Td(t) = if(t<theta,To,T*(t-theta)

could be done the very same way in Prime, too. Mathcad and also Prime offer two ways for an if. The if-statement in a program as you had used and the if-function (similar to the if function in a spreadsheet).

To duplicate in your program what the if-function does, you would have to use the "else" statement instead of the second "if". But the unit problem remains.