Ask Your Question

manipulation of parameter in a plot 2d function

asked 2017-03-22 06:42:45 -0500

psp gravatar image

In Mathematica is possible to plot a function of variables and parameters, giving the possibility to have a slider to change interactively the parameter values. For example this input Manipulate[Plot[1-a/x, {x, 0, 10}], {a, 0, 20}] outputs the plot of the function 1-a/x, where x is the variable, so values are on the x-axis, and a is a parameter and it's exact value is set on a slide bar, between 0 and 20, that appears with running. I tried to do that with Sage, using the @interact possibility but I cannot find a solution for that. Could someone help me?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-03-22 09:55:23 -0500

kcrisman gravatar image

Is this @interact not what you were looking for?

def _(a=slider([0..20],default=2)):
    plot(1-a/x, (x, 0, 10)).show(figsize=3,ymin=-10)
edit flag offensive delete link more


Great! Sorry, I've not found it before.

psp gravatar imagepsp ( 2017-03-23 07:06:37 -0500 )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: 2017-03-22 06:42:45 -0500

Seen: 56 times

Last updated: Mar 22