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

[求助]请教一下关于 solve 函数的问题

[复制链接]
发表于 2005-9-9 16:01:16 | 显示全部楼层 |阅读模式 来自 重庆
最近运用Matlab时遇到下面的问题,还请高手指教
假如:
a=1;
b=2;
c=3;
d=4;
f=5;
solve('a*exp(b*x)+c*exp(d*x)-f=0')为什么该命令无法执行,但是:
solve('1*exp(2*x)+3*exp(4*x)-5=0')却能运行?这是怎么回事?
如果solve无法解决,那还有什么函数可以?
发表于 2005-9-9 18:57:45 | 显示全部楼层 来自 湖北武汉

Re:[求助]请教一下关于 solve 函数的问题

Simdroid开发平台
''引号是不传递外值的。可以如下:
solve(a*exp(b*x)+c*exp(d*x)-f)
发表于 2005-9-9 19:30:02 | 显示全部楼层 来自 新疆乌鲁木齐

Re:[求助]请教一下关于 solve 函数的问题

刚才试了一下,这个表达式本身好像不能执行(但午夜流星的方法对于可得到解析解的表达式是正确的),说明如下:
用正常的solve命令产生下面的提示:
>> solve(a*exp(b*x)+c*exp(d*x)-f)
??? Error using ==> solve
Unable to evaluate expression.
我用maple命令做了一下,产生了一个maple内部的 implicit solutions ,maple对其说明如下:
- In general, explicit solutions in terms of radicals for polynomial equations
  of degree greater than 4 do not exist. In these cases, implicit solutions are
  given in terms of RootOfs. Note that explicit solutions for the general
  quartic polynomial equation are not by default given because they are too
  complicated and messy to be of use. By setting the global variable
  _EnvExplicit to true then solve will return explicit solutions for quartic
  polynomials in all cases. By setting _EnvExplicit to false, all solutions
  which are not rational will be reported as RootOfs.
代入具体数据能够求解个人猜测是具体解或者避免了求解过程中解析符号解的一些内部讨论,所以得到了正解.
另外用fsolve也可以得到数值的实数解
f1=inline('exp(2*x)+3*exp(4*x)-5','x');
fsolve(f1,1)
Optimization terminated successfully:
First-order optimality is less than options.TolFun.
ans =
    0.0633
复数解无法得到.
方便看起见我用maple软件解了一下(当然和在matlab内部调用得到结果相同),得到的结果和上面E文内的说明有点联系.

本帖子中包含更多资源

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

×
 楼主| 发表于 2005-9-9 20:54:18 | 显示全部楼层 来自 重庆

感谢大家的帮助!

感谢斑竹和bainhome的帮助,没有你们的指点不知猴年马月我才能搞清这个问题!呵呵
发表于 2010-11-22 02:18:17 | 显示全部楼层 来自 加拿大
2# *午夜流星*
“引号是不传递外值的”
哥们,你这句话太有用了!
感谢感谢!
回复 不支持

使用道具 举报

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

本版积分规则

Simapps系列直播

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

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

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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