Iterate problem for a complex function and plot it.

Now I have a complex function, for example
1.8633 - 0.00576465 s1^3 + s1^2 (0.160853 - 0.050155 s2) - 1.20076 s2 + 0.161107 s2^2 - 0.00576465 s2^3 + s1 (-1.1984 + 0.631511 s2 - 0.050155 s2^2);
  1. It contains two variables s1 and s2, I can use contour plot the lines that equal to zero.
  2. Give a map T, such that s1 -> s1^2+s1*s2^2; s2 -> s1+s1^2*s2+s2;
  3. After the map, repeat the contour plot for the new function.
Matlab codes:
S1=0:0.01:10;
S2=0:0.01:10;
[s1,s2] = meshgrid(S1,S2);
Z=1.8633 - 0.00576465 .* s1.^3 + s1.^2 .* (0.160853 - 0.050155 .* s2) - 1.20076 .* s2 + 0.161107 .* s2.^2 - 0.00576465 .* s2.^3 + s1 .* (-1.1984 + 0.631511 .* s2 - 0.050155 .* s2.^2);
contour(s1,s2,Z,[0,0])
This figure is Contour when the equation equal to zero, then I want all the points on these lines will iterate by a rule (as above 2).
My question is how to plot it more convenient, my way is solve the funciton first (solve s1), then I can get s1 equal a formula, then do the iterate separately, and plot (s1, s2), but it will be difficult, because there are some solution for s1 at the same time, so I want to know is there any other method do it.
% Since it's a cubic function, there are three solutions,
s1 = f1(s2)
s1 = f2(s2)
s1 = f3(s2)
% Apply the mapping to the three formulas
(news1,news2) = T[s1, f1(s2)]
....(another two are same as this one)
% Then use plot(news1, news2) get new lines which apply the mapping
% But the solution is complicated, so is there any convenient way.

7 commentaires

darova
darova le 12 Juin 2020
I don't understand the question. Can you show something? Maybe a picture with explanations?
Hi zohgxian,
do you mean
s1->s1^2+s1*s2^2;
s2->s1+s1^2*s2+s2;
zongxian
zongxian le 13 Juin 2020
I have add example codes, and change the error, @darova, @David Goodmanson.
darova
darova le 14 Juin 2020
i still don't understand what are you trying to do with those lines
zongxian
zongxian le 14 Juin 2020
Modifié(e) : zongxian le 14 Juin 2020
@darova, every points on these lines will iterate one times (apply map T).
darova
darova le 14 Juin 2020
Are you asking how to extract data from contour?
zongxian
zongxian le 14 Juin 2020
Modifié(e) : zongxian le 14 Juin 2020
if we can extract data that will be a good way. Then I can apply map T on these data. @darova

Connectez-vous pour commenter.

 Réponse acceptée

To extract data from contour use get
[C,h] = contour(...);
xdata = get(h,'xdata');

1 commentaire

zongxian
zongxian le 14 Juin 2020
You gave me some inspiration, and then I iterated through the points I got. Thank you.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Contour Plots dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by