版块导航
正在加载中...
客户端APP下载
论文辅导
登录
注册
帖子
帖子
用户
本版
应《网络安全法》要求,自2017年10月1日起,未进行实名认证将不得使用互联网跟帖服务。为保障您的帐号能够正常使用,请尽快对帐号进行手机号验证,感谢您的理解与支持!
24小时热门版块排行榜
>
论坛更新日志
(2698)
>
虫友互识
(170)
>
找工作
(75)
>
考博
(47)
>
导师招生
(39)
>
基金申请
(39)
>
硕博家园
(39)
>
职场人生
(38)
>
文献求助
(23)
>
招聘信息布告栏
(22)
>
休闲灌水
(15)
>
考研
(10)
>
育儿交流
(9)
>
论文投稿
(8)
>
专利求助
(7)
>
标准与专利
(7)
小木虫论坛-学术科研互动平台
»
计算模拟区
»
程序语言
»
MATLAB/Mathematica
»
用matlab解非线性方程组加for循环语句的问题
2
1/1
返回列表
查看: 2805 | 回复: 1
只看楼主
@他人
存档
新回复提醒
(忽略)
收藏
在APP中查看
zhaoxyah
铁杆木虫
(著名写手)
应助: 3
(幼儿园)
金币: 5329.7
散金: 2779
红花: 5
帖子: 1089
在线: 974.6小时
虫号: 533803
注册: 2008-03-27
专业: 等离子体物理
[
求助
]
用matlab解非线性方程组加for循环语句的问题
已有1人参与
用matlab解非线性方程组,现在问题出在加for 循环语句上,想让其中一参数thita变化来求非线性方程组的解,但是for循环语句加进去之后循环不了,求指教,谢谢
function solve_noneqs2
clear all;clc
format long
x0=[0.8 -5 0.1];
[x fval]=fsolve(@objfun,x0)
function f=objfun(x)
for i=1:10:81
thita=i*3.14/180.0;
gam=0.8;
gama=gam/(cos(thita)+gam*(1-cos(thita)));
nn=0;
mie=1836.0*4.0;
miu=1.0/mie;
tie=0.01;
rou=0.2;
uiy0=-0.01;
e0=-0.01;
f(1)=(1+x(1))*x(3)-(1-gama)*sqrt(2*mie*pi)*exp(x(2))/(1+erf(sqrt(-x(2))));
f(2)=gama*x(3)/(1-gama)-x(1)*sqrt(nn*nn-2*mie*x(2))/(1+x(1));
f(3)=(1+erf(sqrt(-x(2)))+2*exp(x(2)))/(1+erf(sqrt(-x(2))))...
+(-x(1)/(miu*nn*nn-2*x(2)))-(1-rou*uiy0*sin(thita)/e0)/(x(3)*x(3)-tie);
end
回复此楼
» 收录本帖的淘贴专辑推荐
材料学
» 猜你喜欢
硕博巨婴,也许才刚刚开始
已经有69人回复
杭电、天津科技、青农和宁波工程学院如何选?
已经有20人回复
34岁读博士晚吗
已经有26人回复
初始合伙人来啦!(生物试剂耗材标准品)
已经有6人回复
江西双非一本和四川双一流高校如何选择?
已经有23人回复
投稿被一个审稿人恶意评审了怎么样?
已经有7人回复
面青地会评时间
已经有5人回复
关于2023的收入
已经有34人回复
累并快乐着
已经有13人回复
每次骚扰女学生的都是院系领导,而不是普通教师,小编们要注意措辞正确
已经有9人回复
» 本主题相关价值贴推荐,对您同样有帮助:
求助如何用matlab求非线性方程组的解
已经有8人回复
MATLAB解非线性方程组
已经有9人回复
亲们,求助一下,这个非线性方程组怎么解?
已经有11人回复
matlab 解非线性偏微分方程组
已经有6人回复
一个关于有约束非线性方程组的求解问题
已经有7人回复
非线性二阶微分方程组求解,matlab
已经有12人回复
matlab解方程组求助攻
已经有4人回复
matlab 非线性微分方程求解
已经有3人回复
用matlab解非线性方程组
已经有4人回复
Matlab数值求解非线性常微分方程
已经有5人回复
用matlab求解一个非线性方程组的解
已经有4人回复
请教一个matlab求解非线性方程组的问题
已经有9人回复
求解非线性方程组
已经有7人回复
用matlab求解非线性方程组说无解,一定是方程组本身无解,还是有可能程序有问题呢?
已经有11人回复
用fortran程序遗传算法解非线性方程组
已经有7人回复
如何使用灵活求解非线性方程组
已经有22人回复
MATLAB求解非线性方程组
已经有5人回复
matlab无约束非线性方程求最小值的问题
已经有7人回复
【求助】非线性方程组的求解问题
已经有6人回复
matlab语句问题
已经有5人回复
求Matlab高手解决线性方程组的迭代求解问题
已经有17人回复
求fortran解非线性方程组
已经有4人回复
请教用matlab求解一个非线性偏微分方程组的数值解
已经有8人回复
求助matlab---fsolve解非线性方程组
已经有6人回复
matlab求解非线性方程组
已经有16人回复
求高人指点用matlab求解非线性方程组,解决了追加100金币;
已经有11人回复
【求助】matlab求解非线性方程组,并画图处理。要求y,z是实数解!
已经有18人回复
【求助】求教matlab解非线性方程组
已经有9人回复
1楼
2015-01-27 16:06:25
已阅
回复此楼
关注TA
给TA发消息
送TA红花
TA的回帖
月只蓝
主管区长
(职业作家)
专家经验: +1059
应助: 1712
(讲师)
贵宾: 8.888
金币: 67812.9
散金: 1938
红花: 442
沙发: 4
帖子: 4373
在线: 3286.7小时
虫号: 1122189
注册: 2010-10-14
专业: 宇宙学
管辖:
计算模拟区
【答案】应助回帖
★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★
感谢参与,应助指数 +1
zhaoxyah: 金币+30,
★★★★★
最佳答案
2015-01-28 14:35:23
CODE:
function solve_noneqs2
clear all;clc
format long
global thita
x0=[0.8 -5 0.1];
for i=1:10:81
thita=i*3.14/180.0;
[x fval]=fsolve(@objfun,x0)
end
function f=objfun(x)
global thita
gam=0.8;
gama=gam/(cos(thita)+gam*(1-cos(thita)));
nn=0;
mie=1836.0*4.0;
miu=1.0/mie;
tie=0.01;
rou=0.2;
uiy0=-0.01;
e0=-0.01;
f(1)=(1+x(1))*x(3)-(1-gama)*sqrt(2*mie*pi)*exp(x(2))/(1+erf(sqrt(-x(2))));
f(2)=gama*x(3)/(1-gama)-x(1)*sqrt(nn*nn-2*mie*x(2))/(1+x(1));
f(3)=(1+erf(sqrt(-x(2)))+2*exp(x(2)))/(1+erf(sqrt(-x(2))))...
+(-x(1)/(miu*nn*nn-2*x(2)))-(1-rou*uiy0*sin(thita)/e0)/(x(3)*x(3)-tie);
计算结果:
CODE:
Equation solved.
fsolve completed because the vector of function values is near zero
as measured by the default value of the function tolerance, and
the problem appears regular as measured by the gradient.
<stopping criteria details>
x =
0.018846681984329 -3.072831795928832 0.982314870246254
fval =
1.0e-013 *
-0.044408920985006 0.039968028886506 -0.595079541199084
Equation solved.
fsolve completed because the vector of function values is near zero
as measured by the default value of the function tolerance, and
the problem appears regular as measured by the gradient.
<stopping criteria details>
x =
0.018855956779978 -3.075528224076973 0.965321046112058
fval =
1.0e-013 *
-0.004440892098501 0.004440892098501 -0.217603712826531
Equation solved.
fsolve completed because the vector of function values is near zero
as measured by the default value of the function tolerance, and
the problem appears regular as measured by the gradient.
<stopping criteria details>
x =
0.019558737227657 -3.052541979758258 0.948120266395786
fval =
1.0e-014 *
0 -0.355271367880050 -0.710542735760100
Equation solved.
fsolve completed because the vector of function values is near zero
as measured by the default value of the function tolerance, and
the problem appears regular as measured by the gradient.
<stopping criteria details>
x =
0.021135332349230 -2.999752526247271 0.931165724462005
fval =
1.0e-014 *
0.044408920985006 -0.266453525910038 -0.177635683940025
Equation solved.
fsolve completed because the vector of function values is near zero
as measured by the default value of the function tolerance, and
the problem appears regular as measured by the gradient.
<stopping criteria details>
x =
0.024008638352036 -2.909615150811957 0.914786597776324
fval =
1.0e-015 *
0.666133814775094 -0.888178419700125 -0.222044604925031
Equation solved.
fsolve completed because the vector of function values is near zero
as measured by the default value of the function tolerance, and
the problem appears regular as measured by the gradient.
<stopping criteria details>
x =
0.029146638299003 -2.768619210304688 0.899037628244904
fval =
1.0e-014 *
0 -0.177635683940025 0.022204460492503
Equation solved.
fsolve completed because the vector of function values is near zero
as measured by the default value of the function tolerance, and
the problem appears regular as measured by the gradient.
<stopping criteria details>
x =
0.039085890345084 -2.550572682027647 0.883288524779719
fval =
1.0e-015 *
-0.222044604925031 0 0.444089209850063
Equation solved.
fsolve completed because the vector of function values is near zero
as measured by the default value of the function tolerance, and
the problem appears regular as measured by the gradient.
<stopping criteria details>
x =
0.062780505811200 -2.194272858045788 0.864731643692605
fval =
1.0e-014 *
-0.022204460492503 0.177635683940025 0
Equation solved.
fsolve completed because the vector of function values is near zero
as measured by the default value of the function tolerance, and
the problem appears regular as measured by the gradient.
<stopping criteria details>
x =
0.167507062022604 -1.476415003357842 0.830027082398914
fval =
1.0e-015 *
-0.111022302462516 0 0.222044604925031
赞
一下
(1人)
回复此楼
MATLAB、MS小问题、普通问题请发帖求助!时间精力有限,恕不接受无偿私信求助。
2楼
2015-01-27 16:17:35
已阅
回复此楼
关注TA
给TA发消息
送TA红花
TA的回帖
相关版块跳转
第一性原理
量子化学
计算模拟
分子模拟
仿真模拟
程序语言
我要订阅楼主
zhaoxyah
的主题更新
2
1/1
返回列表
如果回帖内容含有宣传信息,请如实选中。否则帐号将被全论坛禁言
普通表情
龙
兔
虎
猫
SCI英文润色翻译-EnPapers美团队-先修改后付款
百度网盘
|
360云盘
|
千易网盘
|
华为网盘
在新窗口页面中打开自己喜欢的网盘网站,将文件上传后,然后将下载链接复制到帖子内容中就可以了。
最具人气热帖推荐
[查看全部]
作者
回/看
最后发表
[
找工作
]
初始合伙人来啦!(生物试剂耗材标准品)
+3
欢快的小科研人
2024-06-15
6/300
2024-06-16 07:13
by
小李小李小李
[
论文投稿
]
投稿被一个审稿人恶意评审了怎么样?
+5
1chen
2024-06-14
7/350
2024-06-15 23:15
by
xy66xy
[
教师之家
]
每次骚扰女学生的都是院系领导,而不是普通教师,小编们要注意措辞正确
+7
zju2000
2024-06-15
9/450
2024-06-15 22:54
by
zeolitess
[
基金申请
]
Nature 11日发文,中国著名学者们称造假迫不得已
+5
babu2015
2024-06-14
5/250
2024-06-15 20:40
by
lc231001
[
硕博家园
]
博士毕业高校和就业的相关问题
+4
SCITOPPP
2024-06-14
6/300
2024-06-15 18:54
by
SCITOPPP
[
考博
]
希望能25博士入学,可提前一年做科研助理
+4
干饭版小太阳
2024-06-09
8/400
2024-06-15 18:36
by
独孤老狗
[
基金申请
]
BO4的YQ答辩通知发布了吗?
+6
博学笃行
2024-06-11
6/300
2024-06-15 16:04
by
悲催科研狗
[
论文投稿
]
求机械类四区sci推荐
5
+3
迷茫小旷
2024-06-14
4/200
2024-06-15 11:25
by
bobvan
[
基金申请
]
有没有机械的前辈分享一下评上海优都是什么成果啊
+7
wulala800
2024-06-10
7/350
2024-06-15 09:33
by
晓目崇
[
食品
]
食品博士导师
+6
小李醒yy
2024-06-11
9/450
2024-06-14 23:37
by
小李醒yy
[
考研
]
物理化学一对一辅导
+3
林大diao
2024-06-12
5/250
2024-06-14 20:57
by
林大diao
[
基金申请
]
化学会年会改成一年开一次了?
+5
babu2015
2024-06-12
13/650
2024-06-14 10:46
by
babu2015
[
论文投稿
]
最近写了一篇控制优化领域的文章,可以投哪里啊?有没有水一些的期刊推荐
+7
香瓜木香
2024-06-12
13/650
2024-06-14 07:05
by
香瓜木香
[
基金申请
]
工材E10口函评结束了吗
10
+3
我1的飞翔
2024-06-13
5/250
2024-06-14 06:35
by
nono2009
[
论文投稿
]
投稿后发现其他作者的邮箱填错了该怎么办呀
10
+4
在飞的猪
2024-06-13
6/300
2024-06-14 04:45
by
小虫子咔咔
[
有机交流
]
旋蒸请教
+6
办公室摸鱼
2024-06-09
9/450
2024-06-13 21:31
by
wuxiaominggo
[
基金申请
]
连续两年医学口青年项目初审体会
+11
进击的荣耀
2024-06-09
18/900
2024-06-13 17:27
by
进击的荣耀
[
硕博家园
]
科研求助
+5
杲www
2024-06-12
6/300
2024-06-13 16:16
by
姓李名明
[
有机交流
]
原料反应完了,怎么知道是产物还是中间体
+6
小胡在努力
2024-06-11
8/400
2024-06-13 13:33
by
091602
[
硕博家园
]
考博应该从哪里开始准备
+6
亮姐2019
2024-06-11
8/400
2024-06-13 12:53
by
帕秋莉GO
信息提示
关闭
请填处理意见
关闭
确定