Skip to main content
1-Visitor
October 8, 2017
Solved

Error when draw a graph in mathcad

  • October 8, 2017
  • 3 replies
  • 4000 views

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 !

Best answer by terryhendicott

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

3 replies

23-Emerald IV
October 8, 2017

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

25-Diamond I
October 8, 2017

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

21-Topaz II
October 8, 2017

Hi,

 

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

Cheers

Terry

marubeni1-VisitorAuthor
1-Visitor
October 9, 2017

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


 

21-Topaz II
October 9, 2017

Hi,

 

Plot of first of vector answers