问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

MATLAB求解联立方程的问题

发布网友 发布时间:2022-05-31 09:42

我来回答

3个回答

热心网友 时间:2023-10-23 14:52

图解法啊?把以下程序copy到edit中,即
>> edit

%__________________
ezplot('x.^3-x.^2=y.^2-y ',[-1 4 -2 2])
hold on
ezplot('x.^2+y.^2=3*x*y.^2 ',[-1 4 -2 2])
grid on
[X1,Y1]=ginput
[X2,Y2]=ginput
%________________________

运行后(F5键),在图形界面出现十字,把十字的中心对准曲线的交叉点,鼠标左键单击,再按回车键,得到X1和Y1的坐标;接着又出现十字,重复以上步骤,得到X2和Y2的坐标。
如果还要更精确,把坐标精细化。如

%__________________
clf
ezplot('x.^3-x.^2=y.^2-y ',[-1 2 -1.5 1.5])
hold on
ezplot('x.^2+y.^2=3*x*y.^2 ',[-1 2 -1.5 1.5])
grid on
[X1,Y1]=ginput
[X2,Y2]=ginput
%________________________

运行结果:
X1 = 0.40211132437620
Y1 = -0.89051094890511
X2 = 1.59980806142035
Y2 = 0.81751824817518

用solve检验
[x,y]=solve('x^2+y^2=3*x*y^2','x^3-x^2=y^2-y')
结果:
x =

[ 0]
[ -.37976068921827954137026288853649-.38991830919330475345517214422894*i]
[ -.37976068921827954137026288853649+.38991830919330475345517214422894*i]
[ .40049531124597856184878557883088]
[ .71811586266609446330558969000379-.27108283538804636925417115137930*i]
[ .71811586266609446330558969000379+.27108283538804636925417115137930*i]
[ 1.5894610085250582609472274849012]

y =

[ 0]
[ -.18172153613294090689416426430526+.29745978808608951704552138953654*i]
[ -.18172153613294090689416426430526-.29745978808608951704552138953654*i]
[ .89222640093375821455336170232293]
[ .64500317468890679025944232957649-.349161514367826464526007371833e-1*i]
[ .64500317468890679025944232957649+.349161514367826464526007371833e-1*i]
[ -.818789678045689981283917832866]

实根差不多,虚根就不能用绘图的方法求了。

热心网友 时间:2023-10-23 14:52

>> [x, y] = solve('x^2+y^2=3*x*y^2','x^3-x^2=y^2-y')

x =

0
.40049531124597856184878557883088
1.5894610085250582609472274849012
.71811586266609446330558969000379+.27108283538804636925417115137930*i
-.37976068921827954137026288853649+.38991830919330475345517214422894*i
-.37976068921827954137026288853649-.38991830919330475345517214422894*i
.71811586266609446330558969000379-.27108283538804636925417115137930*i

y =

0
.89222640093375821455336170232293
-.818789678045689981283917832866
.64500317468890679025944232957649+.3491615143678264645260073718334e-1*i
-.18172153613294090689416426430526-.29745978808608951704552138953654*i
-.18172153613294090689416426430526+.29745978808608951704552138953654*i
.64500317468890679025944232957649-.3491615143678264645260073718334e-1*i

>> help solve
SOLVE Symbolic solution of algebraic equations.
SOLVE('eqn1','eqn2',...,'eqnN')
SOLVE('eqn1','eqn2',...,'eqnN','var1,var2,...,varN')
SOLVE('eqn1','eqn2',...,'eqnN','var1','var2',...'varN')

The eqns are symbolic expressions or strings specifying equations. The
vars are symbolic variables or strings specifying the unknown variables.
SOLVE seeks zeros of the expressions or solutions of the equations.
If not specified, the unknowns in the system are determined by FINDSYM.
If no analytical solution is found and the number of equations equals
the number of dependent variables, a numeric solution is attempted.

Three different types of output are possible. For one equation and one
output, the resulting solution is returned, with multiple solutions to
a nonlinear equation in a symbolic vector. For several equations and
an equal number of outputs, the results are sorted in lexicographic
order and assigned to the outputs. For several equations and a single
output, a structure containing the solutions is returned.

Examples:

solve('p*sin(x) = r') chooses 'x' as the unknown and returns

ans =
asin(r/p)

[x,y] = solve('x^2 + x*y + y = 3','x^2 - 4*x + 3 = 0') returns

x =
[ 1]
[ 3]

y =
[ 1]
[ -3/2]

S = solve('x^2*y^2 - 2*x - 1 = 0','x^2 - y^2 - 1 = 0') returns
the solutions in a structure.

S =
x: [8x1 sym]
y: [8x1 sym]

[u,v] = solve('a*u^2 + v^2 = 0','u - v = 1') regards 'a' as a
parameter and solves the two equations for u and v.

S = solve('a*u^2 + v^2','u - v = 1','a,u') regards 'v' as a
parameter, solves the two equations, and returns S.a and S.u.

[a,u,v] = solve('a*u^2 + v^2','u - v = 1','a^2 - 5*a + 6') solves
the three equations for a, u and v.

See also dsolve.

Overloaded functions or methods (ones with the same name in other directories)
help sym/solve.m

Reference page in Help browser
doc solve

热心网友 时间:2023-10-23 14:53

eq1='
d+(n+p)/2=q';
eq2='
p=n+d+q-10';
eq3='
q+d=p+n/4';
eq4='
q+p=n+8*d-1';
s=solve(eq1,eq2,eq3,eq4,'p,n,d,q')
s.d
s.n
s.p
s.q
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
苹果电脑电池充不进电苹果电脑充不进去电是怎么回事 苹果电脑不充电没反应苹果电脑充电指示灯不亮充不了电怎么办 狗狗更加忠诚护家、善解人意,养一只宠物陪伴自己,泰迪能长多大... 描写泰迪狗的外形和特点的句子 国外留学有用吗 花钱出国留学有用吗 !这叫什么号 百万医疗赔付后是否可以续保 前一年理赔过医疗险还能续保吗? 医疗住院险理赔后还能购买吗? 如何用matlab联立求解下面几个方程 matlab求联立方程数值解 外币银行账户的利息按什么汇率记账 会计用的记账汇率 记账汇率是否每月做调整?怎么样比较合理些?谢谢! 百度一下 ,你知道会计处理中外汇汇率怎么定? 汇率在一天之中也会有浮动,在进行会计核算时应当采用哪个时点的汇率? 我生年八字缺木,用来补补,取什么微信名好呢? 大慨讲一下《孟姜女哭长城》这个故事 孟姜女哭长城的经过 孟姜女哭长城竟然还有后续!这几个关于长城的传说你肯定不知道! 等待是孟姜女千里寻夫哭倒长城的每一滴眼泪 续写 孟姜女哭长城孟姜女死了之后情节是什么 孟姜女到了修长城的地方以后会发生什么事呢她能找到自己的丈夫吗请你结合资料?_百度问一问 孟姜女哭倒长城后怎么样了? 孟姜女后续事情? RavStub.exe 此进程可否关闭? 如何卸载AVG antivirus free 2012 ravantivirus在哪个文件夹 如何关掉avast! Free Antivirus matlab可以解联立的三个方程么 这是Matlab求解方程组,结果每个未知量有四个解,怎么回事? 鸡蛋可以去湿毒吗 如何用matla求解时差方程与频差方程的联立方程组 人身上怎么去湿毒鸡蛋要去壳吗 matlab编写程序画出一个由两个方程联立成的方程组的图形,其中两个方程 鸡蛋能去除人身体上的湿毒是真的吗 求教:用matlab解下面的非线性参联立方程 身体的风气和湿毒用熟鸡蛋可以吸出来? MATLAB问题求解~ matlab联立两个方程无解,求大神看看是什么原因??急急 鸡蛋去湿毒是真的吗 去湿毒最快的好方法 用熟鸡蛋可以解湿毒吗 在脸上滚鸡蛋可以去湿毒吗? 滚鸡蛋能去湿毒吗? 怎样用鸡蛋去湿毒 滚鸡蛋可以去湿毒吗?? 鸡蛋去湿毒是真的吗 两个路由器无线桥接问题 wds连接成功,手机可以通过副路由无线上网, 怎么实名认证吗