Ask Your Question
0

the plot of my function EFF is always zero, but print

asked 2024-03-11 19:29:00 +0100

MarioDV gravatar image

updated 2024-03-11 19:51:17 +0100

The code:

sage: cnodo=[]
sage: cnodo.append(0)
sage: cnodo.append(.5)
sage: cnodo.append(1.4)
sage: cnodo.append(2)
sage: def EFF(x,nodo):
....:     c1=cnodo[nodo]
....:     c2=cnodo[nodo+1]
....:     EFF=0
....:     if (x>=c1)  and (x <= c2)
....:         EFF=(c2-x)/(c2-c1)
....:     return EFF
edit retag flag offensive close merge delete

Comments

1

What is the question?

Max Alekseyev gravatar imageMax Alekseyev ( 2024-03-11 21:03:44 +0100 )edit

first of all I'm sorry for the messy post ,but when I written this I was tired ad upset. The question is the function EFF(x,2) is not zero (linear) in x:{0.5,2} but plot(EFF(x,2),x,0,3) is zero everywhere

MarioDV gravatar imageMarioDV ( 2024-03-12 10:16:35 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2024-03-12 10:56:14 +0100

eric_g gravatar image

Use

plot(lambda x: EEF(x, 2), x, 0, 3)

See the detailed explanations from cell 28 in this tutorial notebook: https://nbviewer.org/github/egourgoul...

edit flag offensive delete link more

Comments

Thanks for the answer and for the indication of the tutorial

MarioDV gravatar imageMarioDV ( 2024-03-12 11:27:39 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2024-03-11 19:29:00 +0100

Seen: 161 times

Last updated: Mar 12