用matlab求解方程式
假設(shè)a和b已知,a,b,x,y>0,求解x和y
a=[1+(0.0172*x)^2]^(-y/2)
b=y*arctan(0.0172*x)
希望可以提供程序代碼,或者解!非常感謝!
返回小木蟲查看更多
今日熱帖
假設(shè)a和b已知,a,b,x,y>0,求解x和y
a=[1+(0.0172*x)^2]^(-y/2)
b=y*arctan(0.0172*x)
希望可以提供程序代碼,或者解!非常感謝!
返回小木蟲查看更多
京公網(wǎng)安備 11010802022153號(hào)
。
這個(gè)盡量不要做伸手黨,求解符號(hào)方程組,看看solve函數(shù)用法
我是去百度了solve用法,但是運(yùn)行的時(shí)候一直顯示錯(cuò)誤,
我最先給a,b賦值進(jìn)行計(jì)算,但是一直顯示運(yùn)算符錯(cuò)誤
syms x y;
>>[x ,y]=solve(' 0.709133=[1+(0.0172*x)^2]^(-y/2)','0.08555=y*arctan(0.0172*x)');
然后使用了未賦值
clc,clear
syms a b y x
sola=solve(a==(1+(0.0172*x)^2)^(-y/2),x) %待求解的變量是x
sol=solve(b==y*atan(0.0172*x),y) %待求解的變量是y
還是運(yùn)算不出想要的東西
因?yàn)橹粫?huì)一點(diǎn)點(diǎn)matlab,就一直解決不了問題。
clear;
syms a b
syms x y positive
eqns=[(1+(0.0172*x)^2)^(-y/2)-a==0, y*atan(0.0172*x)-b==0];
[X,Y]=solve(eqns,[x y])
這個(gè)可能是方程有點(diǎn)問題吧。 a b 的具體數(shù)值是多少
0.709133065 0.08555
0.245947581 0.23527
0.679383641 0.63827
0.32593606 0.51032
0.208709677 0.53469
a和b的值如上,比較小,我也不清楚能不能解出來。
我自己又代入了一下,得到這樣的結(jié)果,是什么意思呢?
Warning: The solutions are parameterized by the symbols: z, z1. To include parameters and conditions in the solution, specify the
'ReturnConditions' option.
> In solve>warnIfParams (line 510)
In solve (line 367)
Warning: The solutions are valid under the following conditions: 1/((1849*z^2)/6250000 + 1)^(z1/2) -
6387302814580195/9007199254740992 == 0 & z1*atan((43*z)/2500) - 1711/20000 == 0 & 0 < z & 0 < z1. To include parameters and
conditions in the solution, specify the 'ReturnConditions' option.
> In solve>warnIfParams (line 517)
In solve (line 367)
X =
z
Y =
z1
,
初始值變化很大,用 vpasolve 函數(shù)賦初始值
clear;
a=0.709133065;b=0.08555;
syms x y positive
eqns=[(1+(0.0172*x)^2)^(-y/2)-a==0, y*atan(0.0172*x)-b==0];
[X,Y]=vpasolve(eqns,[x y],[30000;0.05])