找回密码
 注册
Simdroid-非首页
查看: 163|回复: 10

符号方程求解(提示找不到解答)

[复制链接]
发表于 2010-11-13 13:20:49 | 显示全部楼层 |阅读模式 来自 上海
syms x a
solve('2*x*3.14-sin(2*x*3.14)-2*a=0',x)
请网友帮忙解答一下,是不是该方程无解析解
发表于 2010-11-13 13:31:53 | 显示全部楼层 来自 河北廊坊
Simdroid开发平台
  1. Warning: Explicit solution could not be found.
复制代码
这不就是找不到解析解的意思吗?
回复 不支持

使用道具 举报

 楼主| 发表于 2010-11-13 13:38:54 | 显示全部楼层 来自 上海
2# qibbxxt
请问能利用数值解来解吗 谢谢
回复 不支持

使用道具 举报

发表于 2010-11-13 14:14:36 | 显示全部楼层 来自 黑龙江哈尔滨
显然可以,但不知你的a是变量还是常数呢?
help - fsolve
回复 不支持

使用道具 举报

发表于 2010-11-13 15:45:46 | 显示全部楼层 来自 河北廊坊
3# liuyang5299
  1. >> f=@(x,a)2*x*3.14-sin(2*x*3.14)-2*a

  2. f =

  3. @(x,a)2*x*3.14-sin(2*x*3.14)-2*a

  4. >> fplot(@(x)f(x,1),[-3,3])
  5. >> fzero(@(x)f(x,1),0)

  6. ans =

  7. 0.4067

  8. >> grid on
  9. >> grid minor
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×

评分

1

查看全部评分

回复 不支持

使用道具 举报

发表于 2010-11-13 15:49:23 | 显示全部楼层 来自 河北秦皇岛
我觉得你的方程好像有问题,用solve或是fsolve都能不能求解,你可以看看帮助文档
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.
我看上面的例子就有符合你的方程的形式,你可以换用其他类似的方程试试

评分

1

查看全部评分

回复 不支持

使用道具 举报

 楼主| 发表于 2010-11-13 19:11:44 | 显示全部楼层 来自 上海
4# zhouyang664
a是常数,用a来表示x
回复 不支持

使用道具 举报

发表于 2010-11-13 23:41:50 | 显示全部楼层 来自 湖南湘潭
可以参考:http://forum.simwe.com/thread-902236-2-1.html  27#的方法求数值解。

  1. f = @(x, a) 2*x*3.14 - sin(2*x*3.14) - 2*a;
  2. g = @(a) fzero(@(x)f(x, a), 0);

  3. subplot(2, 1, 1);
  4. fplot(@(x)f(x, 1), [ 0, 5 ]);  % 5# qibbxxt 的程序

  5. a = linspace(0, 5, 100);   
  6. y = arrayfun(g, a);             % 对于一组a,求出对应的根y
  7. subplot(2, 1, 2);
  8. plot(a, y);
复制代码

评分

1

查看全部评分

回复 不支持

使用道具 举报

发表于 2010-11-14 23:34:52 | 显示全部楼层 来自 黑龙江哈尔滨
楼上几位正解!
但不是很理解,楼主说:a是常数,用a来表示x,那岂不是说必须用符号求解,不能用数值方法,但符号解又没有闭式表达式,我看楼主要悲剧了...
楼主将就一下,参考楼上用数值解法吧...
回复 不支持

使用道具 举报

 楼主| 发表于 2010-11-19 18:41:56 | 显示全部楼层 来自 上海
9# zhouyang664
谢谢以上朋友的回复和解答。
如果能给出一个x(a)表达式,近似的能够逼近真实解也可以。数值解,能否给出定义域范围的关系式?
回复 不支持

使用道具 举报

发表于 2010-11-19 23:17:25 | 显示全部楼层 来自 湖南湘潭
本帖最后由 lin2009 于 2010-11-19 23:22 编辑

用Maple来解有一个结果  0.1592356688*RootOf(_Z-2*a-sin(_Z)) ,但却不是“闭式表达式”。
实际上判断根的情况,可以结合图形来分析:
可以将 2*x*3.14-sin(2*x*3.14)-2*a = 0的实根
看成是曲线  y1(x) =  2*x*3.14 - 2*a 与曲线 y2(x) =  sin(2*x*3.14)的交点。
因此画出二者的曲线,就可以判断根的情况和定义域。
从图可知,定义域 -inf < a < inf。

评分

1

查看全部评分

回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Simapps系列直播

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-10-5 09:25 , Processed in 0.043852 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表