由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Computation版 - 用Matlab的fzero解这个单变量非线性方程,总是报错?
相关主题
matlab 能不能解符号矩阵方程? (转载)[合集] 请教数值 解二阶偏微分方程
Matlab 中的 fmincon 函数请问可处理较多变量constrained nonlinear programming 软件有哪些呀
请问什么软件里可以做 多元非线性回归[合集] 请问可处理较多变量或者较多约束条件的constrained nonlinear p
有啥好的optimization的c/c++库可以用为何散度不为零?
求源代码:多元非线性回归(multidimen nonlinear regression) (转载)有人能帮忙解矩阵方程吗?非线性的 (转载)
如何较快掌握有限元模拟的基本理论呢?solve two variable nonlinear in matlab
非线性多变量超定方程组的解法问题mathematica可以解所有的方程吗?
大虾能启发一下我吗???? 关于uncertainty求助:SPICE-like Matlab code
相关话题的讨论汇总
话题: fzero话题: pi话题: exp话题: equation话题: 345e
进入Computation版参与讨论
1 (共1页)
c******k
发帖数: 1140
1
-a*c*log(exp(-pi/(a*d))+exp(pi/(a*d)))+c*pi/d=0
其中
c=3.0e+8
d=345e-9
a的初始值在5.5e+5附近,但是用Matlab的fzero解这个单变量非线性方程,总是报如下
错误:
??? Error using ==> fzero
Function value at starting guess must be finite and real.
Error in ==> D:\NewData\Re-visite PBG Curve\FsolvePBGFun.m
On line 44 ==> x=fzero(inline('-x*(3.0e+8)*log(exp(-pi/(x*(345e-9))+exp(pi/
(x*(345e-9)))))+(3.0e+8)*pi/(345e-9)'),x0,options);
a=5.5e+5的初始值,难道不是finite and real吗?换其它值也报错,怎么回事,谢谢
l*****i
发帖数: 3929
2
拜托请rescale一下你的方程,都出现e+17的系数了

pi/

【在 c******k 的大作中提到】
: -a*c*log(exp(-pi/(a*d))+exp(pi/(a*d)))+c*pi/d=0
: 其中
: c=3.0e+8
: d=345e-9
: a的初始值在5.5e+5附近,但是用Matlab的fzero解这个单变量非线性方程,总是报如下
: 错误:
: ??? Error using ==> fzero
: Function value at starting guess must be finite and real.
: Error in ==> D:\NewData\Re-visite PBG Curve\FsolvePBGFun.m
: On line 44 ==> x=fzero(inline('-x*(3.0e+8)*log(exp(-pi/(x*(345e-9))+exp(pi/

c******k
发帖数: 1140
3
如何调整,c 和 d 就是差别特别大

【在 l*****i 的大作中提到】
: 拜托请rescale一下你的方程,都出现e+17的系数了
:
: pi/

l*****i
发帖数: 3929
4
at least... divide both sides of your equation by c...

【在 c******k 的大作中提到】
: 如何调整,c 和 d 就是差别特别大
l*****i
发帖数: 3929
5
If you divide c on both sides of your equation, and do some simple math, reg
ard y=pi/(d*a), you will get a very simple equation:
log(exp(-y)+exp(y))-y = 0
Isn't this a very nicely scaled equation in y? Solve it using fzero you get
y = 20.48, then
a = pi/(20.48*d) = 4.4463e+5.

pi/

【在 c******k 的大作中提到】
: -a*c*log(exp(-pi/(a*d))+exp(pi/(a*d)))+c*pi/d=0
: 其中
: c=3.0e+8
: d=345e-9
: a的初始值在5.5e+5附近,但是用Matlab的fzero解这个单变量非线性方程,总是报如下
: 错误:
: ??? Error using ==> fzero
: Function value at starting guess must be finite and real.
: Error in ==> D:\NewData\Re-visite PBG Curve\FsolvePBGFun.m
: On line 44 ==> x=fzero(inline('-x*(3.0e+8)*log(exp(-pi/(x*(345e-9))+exp(pi/

c******k
发帖数: 1140
6
太感谢了,我咋这么笨呢

reg
get

【在 l*****i 的大作中提到】
: If you divide c on both sides of your equation, and do some simple math, reg
: ard y=pi/(d*a), you will get a very simple equation:
: log(exp(-y)+exp(y))-y = 0
: Isn't this a very nicely scaled equation in y? Solve it using fzero you get
: y = 20.48, then
: a = pi/(20.48*d) = 4.4463e+5.
:
: pi/

l*****i
发帖数: 3929
7
just found another thing: how did you get such a strange equation? If you do
what I told you to do, you get the equation in y, but it is equivalent to
exp(-y)+exp(y) = exp(y)
which does not have a solution at all! I suspect something in your original
equation was wrong...

【在 c******k 的大作中提到】
: 太感谢了,我咋这么笨呢
:
: reg
: get

c******k
发帖数: 1140
8
I already found this problem either. The good thing is that you give a hint
how to solve this kind of nonlinear equation. Actually I need solve two
nonlinear equations in one group, and there is another parameter b in the
above equation. For simplicity, I just let b=0.

do
original

【在 l*****i 的大作中提到】
: just found another thing: how did you get such a strange equation? If you do
: what I told you to do, you get the equation in y, but it is equivalent to
: exp(-y)+exp(y) = exp(y)
: which does not have a solution at all! I suspect something in your original
: equation was wrong...

l*****i
发帖数: 3929
9
all right, good luck then

hint
you
to

【在 c******k 的大作中提到】
: I already found this problem either. The good thing is that you give a hint
: how to solve this kind of nonlinear equation. Actually I need solve two
: nonlinear equations in one group, and there is another parameter b in the
: above equation. For simplicity, I just let b=0.
:
: do
: original

1 (共1页)
进入Computation版参与讨论
相关主题
求助:SPICE-like Matlab code 求源代码:多元非线性回归(multidimen nonlinear regression) (转载)
2篇基本的matlab有限元编程的paper如何较快掌握有限元模拟的基本理论呢?
matlab能管理多大的内存?>1G非线性多变量超定方程组的解法问题
[转载] matlab算weighted least square大虾能启发一下我吗???? 关于uncertainty
matlab 能不能解符号矩阵方程? (转载)[合集] 请教数值 解二阶偏微分方程
Matlab 中的 fmincon 函数请问可处理较多变量constrained nonlinear programming 软件有哪些呀
请问什么软件里可以做 多元非线性回归[合集] 请问可处理较多变量或者较多约束条件的constrained nonlinear p
有啥好的optimization的c/c++库可以用为何散度不为零?
相关话题的讨论汇总
话题: fzero话题: pi话题: exp话题: equation话题: 345e