Color an area

Color an area

by Regine Martschiske -
Number of replies: 9

Hi

I would like to color the area below the line, can someone tell me if or how it works? This is for a linear optimization task and represents the allowed range.

first the picture as it should be and below that the unfinished picture that I could create with plot

Desired picture


Allowed range

Average of ratings: -
In reply to Regine Martschiske

Re: Color an area

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Regine,

It would help to know what software you are using for your plot?

In reply to AL Rachels

Re: Color an area

by Regine Martschiske -
The first picture is only a screenshot, that was not created by me. So I don't know it.

For the second picture I used Maxima in stack.

In reply to Regine Martschiske

Re: Color an area

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Sorry, I should have also said that if you have a question you are working on, it would help to include the question. Saves time for anyone trying to help, by not making them try to recreate the question from scratch.
Just from some graphing experiments recently, I thought the upper picture was created by JSXGraph.
In reply to AL Rachels

Re: Color an area

by Regine Martschiske -

Ok, I think it is not necessary, but I can add it:

The contribution margin is 1.2 monetary units/ units for a first product and 0.9 MU / units for the second product. What is the optimal production schedule for the following constraints when producing from A x ME and B y ME?

On the picture the restrictions (ie the straight lines) can be read off.

In Maxima you type in for example:

u(k,x1,y1):=-k*x+y<=-k*x1+y1;
load(simplex); u1:x>=0;
u2:y>=0;
u3:y<=5;
u4:u(-1/2,2,5);
u5:u(-3,6,3);
NB:[u1,u2,u3,u4,u5];
DB:1.2*x+0.9*y;
maximize_lp(DB,NB);

which solves the optimization problem (DB=9.9, y=3, x=6)

I hope this helps!

Ps: I don't want to know the answer of the optimal production schedule, because in stack the package "simplex" isn't currently supported. I only want to know how to color the area below the constraintssmile

In reply to Regine Martschiske

Re: Color an area

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Regine,

Just discovered that both of my Moodle's that have STACK on them, that the STACK install is broken. Right now I just don't have time to fix them. Maybe this link, https://people.richland.edu/james/spring15/m122/projects/draw.html will help you some.

I am so sorry. Maybe someone else can help with an answer.

In reply to AL Rachels

Re: Color an area

by Regine Martschiske -

Ok, good luck!

I hope so, too!

Thanks for the link, but the draw-package isn't supported until yet.

In reply to Regine Martschiske

Re: Color an area

by eduardo rivero -

Hi Regine;

The image of your screenshot seems to be created in Geogebra, wich is a mathematical tool with a very strong graphic interface. In geogebra you can define several points with different parametres and constraints and later use them to create a function or even a form derived of some fixed points and other movible. There is actually a geogebra question type for moodle, so you could create a randomly generated question using que geogebra built-in maths assesment.

Gretings

In reply to eduardo rivero

Re: Color an area

by Regine Martschiske -

Hi Eduardo

Thanks for your answer. But I an cannot find a possibility to integrate GeoGebra in the moodle of our university. 

Can you create a screenshot for me to show how it works?

Greetings!


In reply to Regine Martschiske

Re: Color an area

by Stephan Bach -

Hi Regine,

it seems that the GeoGebra question type is only supported up to Moodle 3.3. and I have actually had problems with some versions of these questions running not stable.

The best would probably be if you integrate a geogebra applet via Java Script into a STACK question. You can have a look at this older discussion on this topic. Or you are using JSX Graph - but I myself are still at the very beginning with both solutions.

Stephan.