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

## Error when draw a graph in mathcad  5-Regular Member

## 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  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  i attach the zip file in post . Thank you so much !

1 ACCEPTED SOLUTION

Accepted Solutions  20-Turquoise
(To:marubeni)

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

9 REPLIES 9  23-Emerald II
(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  24-Ruby V
(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:   20-Turquoise
(To:marubeni)

Hi,

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

Cheers

Terry  5-Regular Member
(To:terryhendicott)

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  20-Turquoise
(To:marubeni)

Hi,

Plot of first of vector answers  5-Regular Member
(To:terryhendicott)

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 .   20-Turquoise
(To:marubeni)

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  5-Regular Member
(To:terryhendicott)

Your knowledge in mathcad is so extensive, iam reading your explanation, i hope i can understand it . Thank you so much !  24-Ruby III
(To:terryhendicott)

@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!  