24小时热门版块排行榜    

查看: 951  |  回复: 1

1312758691

新虫 (小有名气)

[求助] Undefined function 'norm' for input arguments of type 'sym'. 已有1人参与

clear;
clc;
S1=[100 300 0];          %the compositions of stream1:N2,H2,NH3
S60=[70 210 1];          %the initial compositions of stream6:N2,H2,NH3
K=0.5;                   %equilibrium constant
P=200*101.325;           %pressure of reaction,KPa
P0=100                   %stander pressure,KPa
tol=0.00001;             %tolerance
%-----------------------------------------------------------------------
%calculate the compositions of stream2:N2,H2,NH3
S2=S1+S60;
%calculate the proportion of a=H2:N2 in the stream2
a=S2(2)/S2(1);
X=solve('K*P*(1-x)^0.5*(a-3*x)^1.5==2*x*(a+1-2*x)*P0');
%calculate the compositions of stream3,stream4,stream5,stream6
delta=-X*S2(1);         %the changement of N2
S3=[delta 3*delta -2*delta];
S4=S2+S3;
S5=[0.005*S4(1) 0.005*S4(2) 0.98*S4(3)];
S6=S4-S5;
%-----------------------------------------------------------------------
%-----------------------------------------------------------------------
%iterative computation
delta_S=S6-S60;
while(norm(delta_S))>tol
      S60=S6;
      S2=S1+S60;
      a=S2(2)/S2(1);
      X=solve('K*P*(1-x)^0.5*(a-3*x)^1.5==2*x*(a+1-2*x)*P0');
      delta=-X*S2(1);         
      S3=[delta 3*delta -2*delta];
      S4=S2+S3;
      S5=[0.005*S4(1) 0.005*S4(2) 0.98*S4(3)];
      S6=S4-S5;
      delta_S=S6-S60;
end
S=[S1;S2;S3;S4;S5;S6]



运行程序出现这样的错误:Undefined function 'norm' for input arguments of type 'sym'.
                                          Error in NH3 (line 25)
                                          while(norm(delta_S))>tol

不知道为什么出现这样的错误,求大侠帮忙解决!谢谢~~~
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

eidie

木虫之王 (文坛精英)

文献杰出贡献

【答案】应助回帖

delta_S变量是一个符号变量,用norm求该向量的模也必须先转化成数值形式。
跟一个女博士相亲,我问她:“你学历这么高,嫁的出去吗?”她说:“这个问题,等我回去写篇论文回答你。”
2楼2015-04-07 09:28:54
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 1312758691 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[硕博家园] 售SCI一区T0P文章,我:8O.55.1.O.5.4,科目齐全,可+急 +3 XlxB7q11Bc3x 2026-09-01 3/150 2026-09-01 21:52 by Y3OMSsg8u9zj
[基金申请] 面上合作单位盖章 +6 ssyjh 2026-08-27 9/450 2026-09-01 20:01 by huagongfeihu
[基金申请] 为什么国自然不能直接公布 +5 bjdxyxy 2026-08-26 5/250 2026-09-01 17:54 by 小伟大博士
[文学芳草园] 梦想 +5 myrtle 2026-08-26 7/350 2026-09-01 15:18 by myrtle
[论文投稿] 小白求助 投论文要求的highlights应该如何写 5+3 l1963982152 2026-08-29 4/200 2026-09-01 09:04 by 北京莱茵编辑
[基金申请] 怎么看青基中了没有啊 +6 叶九微 2026-08-26 6/300 2026-08-31 23:54 by yudaoqian88
[基金申请] 投票:  有多少人是今天查系统知道结果的? +17 爱看书的可乐 2026-08-26 19/950 2026-08-31 21:30 by xiangy672
[基金申请] 基金未中,这种答复是模板吗? +6 zhaosm1982 2026-08-27 7/350 2026-08-31 21:18 by qdxxmc
[基金申请] 能否申诉? +7 echo8914667 2026-08-30 8/400 2026-08-31 17:00 by yihongxu
[基金申请] 29号明天会评吗 +4 笨笨唐 2026-08-28 4/200 2026-08-31 09:30 by huixian257
[基金申请] 基金不中,共勉 +12 eulota 2026-08-26 12/600 2026-08-31 08:42 by ZJTJZ
[基金申请] 为什么到现在没收到通知? +5 tannykie 2026-08-29 5/250 2026-08-30 21:05 by purplejack
[基金申请] 有没有仍没收到信息的 +7 德尚中行 2026-08-27 8/400 2026-08-30 20:52 by purplejack
[基金申请] 我就是申请一个面上项目而已,这评审意见是按照杰青的条件评的吧? +6 gouxfjh 2026-08-28 11/550 2026-08-30 07:57 by gouxfjh
[基金申请] 国自然面上复盘~欢迎讨论 (金币+15) +15 晴天加油 2026-08-26 16/800 2026-08-29 18:28 by symmetry
[基金申请] 国自然评审意见 +13 wangmingqi 2026-08-28 19/950 2026-08-29 10:22 by Poppy1104
[基金申请] 2026年叶企孙基金 +4 bud_bud 2026-08-27 7/350 2026-08-29 07:23 by foolishmani
[基金申请] 我不理解! +15 Edward_pc 2026-08-26 23/1150 2026-08-26 20:34 by zzuzxg
[基金申请] 国合里面能看到了 +7 一怀馨秋 2026-08-26 7/350 2026-08-26 11:23 by zhaosm1982
[基金申请] 国合可查了 +3 paperzjh 2026-08-26 3/150 2026-08-26 10:41 by LemmonTr
信息提示
请填处理意见