Ask Your Question

My error with @interact

asked 2020-05-22 09:26:55 -0600

Cyrille gravatar image

updated 2020-05-23 01:01:14 -0600

FrédéricC gravatar image

I suppose it's not the custom to reuse a question, but the precedent was not a problem with Sagemath but with my computer

Here is a true question due to my incompetence. The following code leads onlys to the slider not the display of the function.

p, D, w_0, x, I = var('p, D, w_0, x, I')
β = var('beta')
π = var('pi') 

A = matrix(SR, 2, 2, [[w_0, 1],[w_0-π,1]])
y = vector([w_0-D, w_0-D-π+I])
sola=sol[0].full_simplify().function(D, π, w_0)
solb=sol[1].full_simplify().function(D, π, I, w_0)
f=(sola*x + solb).function(x, D, π, I, w_0)
g=f(x, D, β*I*(1-p), I, w_0).factor().collect(x).simplify().function(x, D, β, p, w_0)
def _(β=slider(1,5, step_size=1)):
    s1sol=solve(g(x,D1,β,p1,w00)==x, x)
    glou=plot(g(x,D1,β,p1,w00),(x, intersect2,w00))
    glou+=circle((intersect2,intersect2), .075, fill=True, edgecolor='red', facecolor='red')
    glou+=arc((w00,w00-D1),1.75,1.75,0,(3.14/2+3.14/4,3.14), linestyle="--", color="green")

What do I do wrong ?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2020-05-22 11:35:53 -0600

tmonteil gravatar image

You should ask the function to actually do something, so replace glou+plccp with show(glou+plccp). By the way, plccp is not defined in your code.

edit flag offensive delete link more


Yes of course. I will erase plccp since it add nothing to the question. Thanks

Cyrille gravatar imageCyrille ( 2020-05-22 12:01:24 -0600 )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

1 follower


Asked: 2020-05-22 09:26:55 -0600

Seen: 77 times

Last updated: May 23