Solve an equation of fourth degree with two variables

I have to solve an equation of fourth degree with two variables, and draw the line where it is equal to zero. I tried to do that but I got an error message when I tried to place a value in x1_sol:
syms x y;
v=1/16*(3*x+17*y/3)*(-x^3-6*y^2-11*x+y)+1/96*(34*x+130*y)*/(3*x-y);
x_sol=solve(v==0,x,'MaxDegree', 4);
x1_sol=x_sol(1);
x1_sol(9);
Where am I wrong? Do I use the right way?

3 件のコメント

Valmir Sadiku
Valmir Sadiku 2013 年 5 月 22 日
what error you got?
AAA
AAA 2013 年 5 月 23 日
編集済み: AAA 2013 年 5 月 23 日
Error using mupadmex
Error in MuPAD command: Index exceeds matrix dimensions.
Error in sym/subsref (line 1577)
B = mupadmex('symobj::subsref',A.s,inds{:});
Error in Hw4 (line 7)
x1_sol(9);
Walter Roberson
Walter Roberson 2013 年 5 月 23 日
*/ is not a valid operation.

サインインしてコメントする。

 採用された回答

Valmir Sadiku
Valmir Sadiku 2013 年 5 月 23 日

0 投票

i don't know what you are trying with this command x1_sol=x_sol(1); because the size of the x_sol are:
>> size(x_sol)
ans =
1 1
that's because it should be clear why x1_sol(9); give you an error message!

5 件のコメント

AAA
AAA 2013 年 5 月 23 日
I'm trying to set the parameter value Y to calculate X.
I want to calculate the value of X for a vector of Y. How do I do this?
Valmir Sadiku
Valmir Sadiku 2013 年 5 月 23 日
as far i understand you will solve this equation system:
v = 1/16*(3*x+17*y/3)*(-x^3-6*y^2-11*x+y)+1/96*(34*x+130*y)/(3*x-y);
y = 9;
if there so, you can do it in this way:
syms x y;
v=1/16*(3*x+17*y/3)*(-x^3-6*y^2-11*x+y)+1/96*(34*x+130*y)*/(3*x-y);
x_sol=solve(v==0, y ==9);
hopefully it will help you!
Walter Roberson
Walter Roberson 2013 年 5 月 23 日
Yvals = linspace(-10, 10, 101);
Xvals = double(subs(x_sol, y, Yvals));
Valmir Sadiku
Valmir Sadiku 2013 年 5 月 23 日
i never saw this command 'subs' bevor, so i think now you got the solution of your problem?
AAA
AAA 2013 年 5 月 24 日
編集済み: AAA 2013 年 5 月 24 日
yes, it's exactly what I needed. thanks!

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by