Iza

35 Reputation

4 Badges

8 years, 313 days

MaplePrimes Activity


These are replies submitted by Iza

I think this is the only version I haven't tried. Thank you for your comprehensive answers. I hope somene else can also benefit in the future from this post.

Iza

@acer , of course, now I can see that.

I have just one more question: how can I set different types of alignment for textplots? For example: ['above','left'] for first textplot and ['above','right'] for second. I've tried many different options and none of them works:

'align'=[['above','left'],['above','right']]
['align'=['above','left'],'align'=['above','right']]
'align'=['above','left'],'align'=['above','right']

@acer , thank you very much. Your explanations and code examples made things more clear for me. I have one more question connected with this example and I think that will be all in this subject. Why two methods shown below give different effects? For me the sequence of operations are the same in both versions:

restart;
with(plots);
f1 := x -> a*x^2;
f2 := x -> a*x^2 + 0.3000000000;
expr1 := f1(x);
expr2 := f2(x);
plot1 := animate(plot, [expr1, x = -1 .. 1, color = ["Green"], thickness = 3], a = 0.2000000000 .. 1.2000000000);
plot2 := animate(plot, [expr2, x = -1 .. 1, color = ["Red"], thickness = 3], a = 0.2000000000 .. 1.2000000000);
display([plot1, plot2]);
 
restart;
with(plots);
f1 := x -> a*x^2;
f2 := x -> a*x^2 + 0.3000000000;
expr1 := f1(x);
expr2 := f2(x);
plot1 := animate(plot, [[expr1, expr2], x = -1 .. 1, color = ["Green", "Red"], thickness = 3], a = 0.2000000000 .. 1.2000000000):
display(plot1);

@acer , all your help and ideas are appreciated. And, of course, I know that it is a simple problem if you're fluent in Maple. As you can see, I am not, but sometimes have to use it.

My concern about A in previous post was: is it neccessary to use it if you create the animation (not a simple frame) but without using a procedure. I am not saying that procedure is bad, but for me, it is easier to understand the syntax starting from the basic form. Then, when I know how it works, I can transform it into more efficient form of procedure.

@acer , thank you. It is great but now I have to understand how it works ;-)

Especially I have a problem with variable A. Is it neccesary only for creating procedure or is it connected with using parameter a in the elements of animation (like e.g.: f2(a/2)) .

I am trying to use your idea but without building procedure to understant the basis of it. Unfortunately I have also a problem with that.

I don't know the possible options so it's hard to be more precise at the beginning.

I think texplot near the point on the graph would be perfect but it can be placed wherever it will be visible. The text should be: f=value_of_the_function(x).

I wrote that x=1 but would it be possible to define x depending on the parameter a, e.g. x=a/2? Then it would change with each frame of the animation.

Thank you.

@acer , thanks for your help.

Usually I try to solve the problems on my own. I found some helpful clues in older questions here at Mapleprimes and tried to put them together to solve my problem but as you see it became more complicated.

The syntax I used before was taken from this forum. Thank you for your suggestion to make it simpler.

Thank you all for your reactions. I understand that it is easier to use expressions but for some reasons I had to define my functions with the use of operators and now I need to draw the interactive plot.

acer, your method works fine but unfortunately in my original problem I have two additional issues. Again I will show it on the same example.

1. I need to switch the axes, so first I define plots as below

2. In my problem the range of the variable depends on the parameter (below: x=-a..a) 

restart;
with(plots):
with(plottools):
f1:=x->a*x^2:f2:=x->a*x^2+1:f1(x);f2(x);
Parab1 := ''plot([f1(x),x, x=-a .. a],color="Red")'':
Parab2 := ''plot([f2(x),x, x=-a .. a],color="Green")'':


I don't know how to define "Explore" command in such case.

Thanks a lot,

Iza

@Kitonum , thanks a lot. Your method is also fine and it's simpler :-)

Iza

@tomleslie , thank you a lot. I've tried something similar but it wasn't correct.

Iza

Thank you all. Now everything works just fine.

Thanks for your reply. Sorry, I forgot about the value of m because I've got it earlier in my code, but it's not the problem. In my example it shuld be 4. Also, I don't use  the nested loop because my data is in vectors. The only problem is that I have to solve the system of 2 equations with 2 unknowns in every loop and then write the values of solution in a matrix called Force (each pair should be a row in a matrix).

@tomleslie , thanks. That's exactly what I wanted to do but there is one problem. I'm using Maple16 and, as far as I can see, the operator ~ doesn't work with rhs in this version. I get an error: invalid input: rhs expects 1 argument, but received 2.

@Kitonum , thank you very much.

I've tried something similar but apparently there was something wrong.

Regards,

Iza

@Carl Love , thank you for an extensive explanation of the problem. I've tried few different methods of defining f, g and h, but always had a problem, either with command map or with creating a plot and finally got confused.

Regards,

Iza

1 2 Page 1 of 2