0

Consider the following system of two nonlinear (quadratic) equations with = 0.400256 and = 0.916403.

− + − + ^2 = 0

− + + − ^2 = 0

Plot the two implicit equations and observe that there are two solutions: one at the origin and the other one close to (1.3, 0.8).

Here is what my code looks like so far:

a=0.400256;
b=0.916403;
f = @(x) [-x(1) + a*x(1) - b*x(2) + b*x(1)^2];
f2 = @(x) [-x(2) + b*x(1) + a*x(2) - a*x(1)^2];
ezplot('f',[-10 10 -10 10]); hold on;
ezplot('f2',[-10 10 -10 10]);
grid
Pang
  • 9,564
  • 146
  • 81
  • 122
A. T
  • 19
  • 4
  • StackOverflow is not for homework questions. It's important to think through these problems and try to find a solution yourself. If you run into programming problems then we are here to help, not to do your homework. – Vedda Dec 04 '16 at 02:31
  • Post any errors received thus far. – T-Heron Dec 04 '16 at 02:41
  • That's better, but what is your specific question? Have you hit an error, or trying to do something that isn't working? – Vedda Dec 04 '16 at 02:52
  • Whenever I plot it, it shows only one line (both equations over each other). How do I show two quadratic functions separately but on one graph? Sorry I am new to MATLAB @THeron – A. T Dec 04 '16 at 03:13

1 Answers1

2

You were on the right track, but didn't defined the functions properly.

a=0.400256;
b=0.916403;
f1 = @(x,y) -x + a*x - b*y + b*x.^2;
f2 = @(x,y) -y + b*x + a*y - a*x.^2;
ezplot(f1);
hold on
ezplot(f2);
zhk
  • 331
  • 2
  • 16