cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Basic Function Incorrect Result

Jim35
4-Participant

Basic Function Incorrect Result

Greetings,

I just started learning Mathcad and have been getting incorrect calculations using the sin function, when t=1s and 2s, Mathcad gives me the same result and the result is not even correct (t=1s, it should've been 3.41 not 4.33; when t=2s, it should've been 2.193), I am also getting a straight curve instead of a sin wave. Can anybody help me out? Capture.PNG

 

 

 

6 REPLIES 6
mpomerleau
6-Contributor
(To:Jim35)

Change your Range Variable, t....

You are plotting only 2 points -1 and 0.001 and it is drawing a line between the two points.  The first point is -1 sec - the second point is 0.001 seconds - that gives an interval of 1.001 seconds - therefore the thirdpoint would be 1.002 seconds which is larger than the final limit of 1sec....

You clearly wanted to plot from -1. to +1sec in 0.001 intervals....

Change the range variable to

     t:=-1 s,-0.999 s .. 1 s

that should fix it....

Hope that helps....(dont have MC installed at home so I cant fix it or show an example).

VTsin.png

Jim35
4-Participant
(To:ValeryOchkov)

Thank you for your reply ValeryOchkov. I still don't know why E(t) function gives me the same result even though I specified two different variables for t=1s and t=2s. Could you shed some lights on it?

Jim35
4-Participant
(To:mpomerleau)

Thank you mpomerleau!

 

Do you know why when I used t=1sec and t=2sec, I was getting the same and incorrect result from E(t)? The results should be different.

mpomerleau
6-Contributor
(To:Jim35)

Yeah,

 

Those answers are both correct - because your frequency is an integer.

 

Your function is periodic - freq - 60 Hz.  It repeats exactly 60 times a second......

 

In the time interval from One Second to two seconds you would have gone through exactly 60 cycles - and be at exactly the same point.  Any interval which was a multiple of 1/60 seconds would get you exactly the same value. 

 

Change your frequency to a non integer - i.e. (60.1 Hz and you will not have the same value at 1 and 2 seconds).

 

 

Jim35
4-Participant
(To:mpomerleau)

Thank you VERY MUCH!

Top Tags