当前位置: 首页 > 计算模拟 >用matlab求解方程式

用matlab求解方程式

作者 钟声入翠微
来源: 小木虫 500 10 举报帖子
+关注

假设a和b已知,a,b,x,y>0,求解x和y
a=[1+(0.0172*x)^2]^(-y/2)
b=y*arctan(0.0172*x)
希望可以提供程序代码,或者解!非常感谢! 返回小木虫查看更多

今日热帖
  • 精华评论
  • zf015222



  • 独孤神宇

    这个尽量不要做伸手党,求解符号方程组,看看solve函数用法

  • 钟声入翠微

    引用回帖:
    3楼: Originally posted by 独孤神宇 at 2021-07-05 19:49:57
    这个尽量不要做伸手党,求解符号方程组,看看solve函数用法

    我是去百度了solve用法,但是运行的时候一直显示错误,
    我最先给a,b赋值进行计算,但是一直显示运算符错误
    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
    还是运算不出想要的东西
    因为只会一点点matlab,就一直解决不了问题。

  • 独孤神宇

    引用回帖:
    4楼: Originally posted by 钟声入翠微 at 2021-07-06 09:02:45
    我是去百度了solve用法,但是运行的时候一直显示错误,
    我最先给a,b赋值进行计算,但是一直显示运算符错误
    syms x y;
    >>=solve(' 0.709133=^(-y/2)','0.08555=y*arctan(0.0172*x)');
    然后使用 ...

    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])

    这个可能是方程有点问题吧。 a  b  的具体数值是多少

  • 钟声入翠微

    引用回帖:
    5楼: Originally posted by 独孤神宇 at 2021-07-06 12:51:49
    clear;
    syms a b
    syms x y positive
    eqns=;
    =solve(eqns,)

    这个可能是方程有点问题吧。 a  b  的具体数值是多少...

    0.709133065        0.08555
    0.245947581        0.23527
    0.679383641        0.63827
    0.32593606        0.51032
    0.208709677        0.53469

    a和b的值如上,比较小,我也不清楚能不能解出来。

  • 钟声入翠微

    引用回帖:
    5楼: Originally posted by 独孤神宇 at 2021-07-06 12:51:49
    clear;
    syms a b
    syms x y positive
    eqns=;
    =solve(eqns,)

    这个可能是方程有点问题吧。 a  b  的具体数值是多少...

    我自己又代入了一下,得到这样的结果,是什么意思呢?

    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

  • 独孤神宇

    引用回帖:
    7楼: Originally posted by 钟声入翠微 at 2021-07-06 14:53:48
    我自己又代入了一下,得到这样的结果,是什么意思呢?

    Warning: The solutions are parameterized by the symbols: z, z1. To include parameters and conditions in the solution, specify the
    'ReturnCondit ...

    初始值变化很大,用 vpasolve 函数赋初始值

    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])

猜你喜欢
下载小木虫APP
与700万科研达人随时交流
  • 二维码
  • IOS
  • 安卓