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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Error when draw a graph in mathcad

marubeni
8-Gravel

Error when draw a graph in mathcad

hi everyone, i have a problem in drawing the graph, i don't know why it's wrong

1.PNG

2.PNG

i want to draw the graph same as the second picture but as you see in the first picture, the graph has error.

Here is the program

1.PNG2.PNG

i attach the zip file in post . Thank you so much !

ACCEPTED SOLUTION

Accepted Solutions

Hi,

"Thank you , but can i ask you that why it is V.fl(k)1 and not is V.fl(k) in the graph, i don't know ."

 

The programming for Z(k) does not have a specific return statement.  The program automatically returns Z which is a two column vector as the last thing returned is an element of Z.  If you specifically "return" the first term of Z you only get one answer for Z.

 

I have done that in the enclosed sheet

View solution in original post

9 REPLIES 9
LucMeekes
23-Emerald III
(To:marubeni)

Mathcad will not plot complex numbers.

Your program uses a lot of complex numbers. I would not be surprised if Z(k) contains a lot of complex numbers as a result. In fact your program is prepared ( in its last line) to let the result with index 1 become it's real part.

 

Find a way to treat those complex results. Either plot just the real part of the x and y- values (so plot Re(g(k)) versus Re(Vfl(k)).

Or plot the magnitude of the complex numbers.

Whichever makes more sense to your application.

 

Success!

Luc

Werner_E
25-Diamond I
(To:marubeni)

Your function Z returns a 2-element vector, not a scalar. Thats the main reason for the error.

Maybe this helps, even though the plot looks different from the one you try to duplicate:

Bild1.png

Hi,

 

Perhaps if you supply the background information we can check your implimentation of the mathematics behind the graph

Cheers

Terry

i attach the zip file in post. Thank you very much!. Iam a beginner in mathcad so something is overcome my understanding .


@terryhendicott wrote:

Hi,

 

Perhaps if you supply the background information we can check your implimentation of the mathematics behind the graph

Cheers

Terry


 

Hi,

 

Plot of first of vector answers

Thank you , but can i ask you that why it is V.fl(k)1 and not is V.fl(k) in the graph, i don't know . 

Capture.PNG

Hi,

"Thank you , but can i ask you that why it is V.fl(k)1 and not is V.fl(k) in the graph, i don't know ."

 

The programming for Z(k) does not have a specific return statement.  The program automatically returns Z which is a two column vector as the last thing returned is an element of Z.  If you specifically "return" the first term of Z you only get one answer for Z.

 

I have done that in the enclosed sheet

Your knowledge in mathcad is so extensive, iam reading your explanation, i hope i can understand it . Thank you so much !


@terryhendicott wrote:

The programming for Z(k) does not have a specific return statement.


It will be good if each Mathcad-program has the return operator!

Better for the understanding!

Return.png

Announcements

Top Tags