声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 4828|回复: 13

[编程技巧] 如何实现符号型表达式转换为数值型表达式

[复制链接]
发表于 2006-11-19 11:26 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
请教一下大家,我做了一个积分,采用了符号型变量得出了符号型表达式,可是我后续的优化需要采用数值型的表达式,大家看看有什么函数可以转换么?谢谢了压

评分

1

查看全部评分

回复
分享到:

使用道具 举报

发表于 2006-11-19 11:35 | 显示全部楼层
原帖由 menyueqi 于 2006-11-19 11:26 发表
请教一下大家,我做了一个积分,采用了符号型变量得出了符号型表达式,可是我后续的优化需要采用数值型的表达式,大家看看有什么函数可以转换么?谢谢了压



符号型表达式是多项式吗?如果是,用sym2poly函数就可以了
 楼主| 发表于 2006-11-19 11:39 | 显示全部楼层
使得,谢谢压。我试试

好像不行,转换不过去,您还有什么方法么?

[ 本帖最后由 ChaChing 于 2010-3-15 13:54 编辑 ]
发表于 2006-11-19 12:12 | 显示全部楼层
你把表达式贴出来看看。
发表于 2006-11-19 12:23 | 显示全部楼层
可以考虑一下vpa&digits&subs&double等等函数的结合
 楼主| 发表于 2006-11-19 15:06 | 显示全部楼层
我也不知道我怎么得出的这个结果,但是编程的感觉上没错,就是有效位没处理好。大家看看能不能指点一下,所有的变量设置都是符号型定义的,我就想把这个表达式变成数值型的


C =

10/(int((1-893/1000*y)/(int(17827755986268819/75557863725914323419136*exp((-1980861776252091/1125899906842624*y)^(3/2))*220095752916899^(1/2)*y^(1/2)+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496*exp((-5942585328756273/37778931862957161709568*y+5942585328756273/37778931862957161709568*x)/(1-893/1000*x)^(4663797269027135/144115188075855872)*(-(-220095752916899*y+220095752916899*x)/(1-893/1000*x)^(4663797269027135/144115188075855872))^(1/2)+(-1980861776252091/1125899906842624*x)^(3/2))/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*x^(1/2),x = 0 .. y),y = 0 .. xl)+1)*(17827755986268819/75557863725914323419136*exp((-1980861776252091/1125899906842624*y)^(3/2))*220095752916899^(1/2)*y^(1/2)+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496*exp((-5942585328756273/37778931862957161709568*y+5942585328756273/37778931862957161709568*x)/(1-893/1000*x)^(4663797269027135/144115188075855872)*(-(-220095752916899*y+220095752916899*x)/(1-893/1000*x)^(4663797269027135/144115188075855872))^(1/2)+(-1980861776252091/1125899906842624*x)^(3/2))/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*x^(1/2),x = 0 .. y)),x = 0 .. xl)+1/(int(17827755986268819/75557863725914323419136*exp((-1980861776252091/1125899906842624*y)^(3/2))*220095752916899^(1/2)*y^(1/2)+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496*exp((-5942585328756273/37778931862957161709568*y+5942585328756273/37778931862957161709568*x)/(1-893/1000*x)^(4663797269027135/144115188075855872)*(-(-220095752916899*y+220095752916899*x)/(1-893/1000*x)^(4663797269027135/144115188075855872))^(1/2)+(-1980861776252091/1125899906842624*x)^(3/2))/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*x^(1/2),x = 0 .. y),y = 0 .. xl)+1))+(100/(1+int(5942585328756273/2535301200456458802993406410752*1980861776252091^(1/2)*1125899906842624^(1/2)*y^(1/2)*exp((-1980861776252091/1125899906842624*y)^(3/2))+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*exp(-1980861776252091/1267650600228229401496703205376*1980861776252091^(1/2)*1125899906842624^(1/2)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(3/2))*x^(1/2)*exp((-1980861776252091/1125899906842624*x)^(3/2)),x = 0 .. y),y = 0 .. xl))*(exp((-1980861776252091/1125899906842624*xl)^(3/2))+(3495033822598783/9007199254740992+8301468363699109/9007199254740992*i)/(1+int(5942585328756273/2535301200456458802993406410752*1980861776252091^(1/2)*1125899906842624^(1/2)*y^(1/2)*exp((-1980861776252091/1125899906842624*y)^(3/2))+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*exp(-1980861776252091/1267650600228229401496703205376*1980861776252091^(1/2)*1125899906842624^(1/2)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(3/2))*x^(1/2)*exp((-1980861776252091/1125899906842624*x)^(3/2)),x = 0 .. y),y = 0 .. xl)))+100*(1-1/(1+int(5942585328756273/2535301200456458802993406410752*1980861776252091^(1/2)*1125899906842624^(1/2)*y^(1/2)*exp((-1980861776252091/1125899906842624*y)^(3/2))+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*exp(-1980861776252091/1267650600228229401496703205376*1980861776252091^(1/2)*1125899906842624^(1/2)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(3/2))*x^(1/2)*exp((-1980861776252091/1125899906842624*x)^(3/2)),x = 0 .. y),y = 0 .. xl)))*(int(exp((-1980861776252091/1125899906842624/(1-893/1000*x)^(4663797269027135/144115188075855872)*(xl-y))^(3/2))/(1+int(5942585328756273/2535301200456458802993406410752*1980861776252091^(1/2)*1125899906842624^(1/2)*y^(1/2)*exp((-1980861776252091/1125899906842624*y)^(3/2))+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*exp(-1980861776252091/1267650600228229401496703205376*1980861776252091^(1/2)*1125899906842624^(1/2)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(3/2))*x^(1/2)*exp((-1980861776252091/1125899906842624*x)^(3/2)),x = 0 .. y),y = 0 .. xl))*(5942585328756273/2535301200456458802993406410752*1980861776252091^(1/2)*1125899906842624^(1/2)*y^(1/2)*exp((-1980861776252091/1125899906842624*y)^(3/2))+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*exp(-1980861776252091/1267650600228229401496703205376*1980861776252091^(1/2)*1125899906842624^(1/2)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(3/2))*x^(1/2)*exp((-1980861776252091/1125899906842624*x)^(3/2)),x = 0 .. y))/(1-1/(1+int(5942585328756273/2535301200456458802993406410752*1980861776252091^(1/2)*1125899906842624^(1/2)*y^(1/2)*exp((-1980861776252091/1125899906842624*y)^(3/2))+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*exp(-1980861776252091/1267650600228229401496703205376*1980861776252091^(1/2)*1125899906842624^(1/2)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(3/2))*x^(1/2)*exp((-1980861776252091/1125899906842624*x)^(3/2)),x = 0 .. y),y = 0 .. xl))),y = 0 .. xl)-int(exp((-1980861776252091/1125899906842624/(1-893/1000*x)^(4663797269027135/144115188075855872)*(893/1000-y))^(3/2))/(1+int(5942585328756273/2535301200456458802993406410752*1980861776252091^(1/2)*1125899906842624^(1/2)*y^(1/2)*exp((-1980861776252091/1125899906842624*y)^(3/2))+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*exp(-1980861776252091/1267650600228229401496703205376*1980861776252091^(1/2)*1125899906842624^(1/2)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(3/2))*x^(1/2)*exp((-1980861776252091/1125899906842624*x)^(3/2)),x = 0 .. y),y = 0 .. xl))*(5942585328756273/2535301200456458802993406410752*1980861776252091^(1/2)*1125899906842624^(1/2)*y^(1/2)*exp((-1980861776252091/1125899906842624*y)^(3/2))+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*exp(-1980861776252091/1267650600228229401496703205376*1980861776252091^(1/2)*1125899906842624^(1/2)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(3/2))*x^(1/2)*exp((-1980861776252091/1125899906842624*x)^(3/2)),x = 0 .. y))/(1-1/(1+int(5942585328756273/2535301200456458802993406410752*1980861776252091^(1/2)*1125899906842624^(1/2)*y^(1/2)*exp((-1980861776252091/1125899906842624*y)^(3/2))+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*exp(-1980861776252091/1267650600228229401496703205376*1980861776252091^(1/2)*1125899906842624^(1/2)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(3/2))*x^(1/2)*exp((-1980861776252091/1125899906842624*x)^(3/2)),x = 0 .. y),y = 0 .. xl))),y = 0 .. xl)))/(int((1-893/1000*y)/(int(17827755986268819/75557863725914323419136*exp((-1980861776252091/1125899906842624*y)^(3/2))*220095752916899^(1/2)*y^(1/2)+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496*exp((-5942585328756273/37778931862957161709568*y+5942585328756273/37778931862957161709568*x)/(1-893/1000*x)^(4663797269027135/144115188075855872)*(-(-220095752916899*y+220095752916899*x)/(1-893/1000*x)^(4663797269027135/144115188075855872))^(1/2)+(-1980861776252091/1125899906842624*x)^(3/2))/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*x^(1/2),x = 0 .. y),y = 0 .. xl)+1)*(17827755986268819/75557863725914323419136*exp((-1980861776252091/1125899906842624*y)^(3/2))*220095752916899^(1/2)*y^(1/2)+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496*exp((-5942585328756273/37778931862957161709568*y+5942585328756273/37778931862957161709568*x)/(1-893/1000*x)^(4663797269027135/144115188075855872)*(-(-220095752916899*y+220095752916899*x)/(1-893/1000*x)^(4663797269027135/144115188075855872))^(1/2)+(-1980861776252091/1125899906842624*x)^(3/2))/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*x^(1/2),x = 0 .. y)),x = 0 .. xl)+1/(int(17827755986268819/75557863725914323419136*exp((-1980861776252091/1125899906842624*y)^(3/2))*220095752916899^(1/2)*y^(1/2)+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496*exp((-5942585328756273/37778931862957161709568*y+5942585328756273/37778931862957161709568*x)/(1-893/1000*x)^(4663797269027135/144115188075855872)*(-(-220095752916899*y+220095752916899*x)/(1-893/1000*x)^(4663797269027135/144115188075855872))^(1/2)+(-1980861776252091/1125899906842624*x)^(3/2))/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*x^(1/2),x = 0 .. y),y = 0 .. xl)+1))+(2000*int(exp((-1980861776252091/1125899906842624/(1-893/1000*x)^(4663797269027135/144115188075855872)*(893/1000-y))^(3/2))/(int(17827755986268819/75557863725914323419136*exp((-1980861776252091/1125899906842624*y)^(3/2))*220095752916899^(1/2)*y^(1/2)+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496*exp((-5942585328756273/37778931862957161709568*y+5942585328756273/37778931862957161709568*x)/(1-893/1000*x)^(4663797269027135/144115188075855872)*(-(-220095752916899*y+220095752916899*x)/(1-893/1000*x)^(4663797269027135/144115188075855872))^(1/2)+(-1980861776252091/1125899906842624*x)^(3/2))/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*x^(1/2),x = 0 .. y),y = 0 .. xl)+1)*(17827755986268819/75557863725914323419136*exp((-1980861776252091/1125899906842624*y)^(3/2))*220095752916899^(1/2)*y^(1/2)+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496*exp((-5942585328756273/37778931862957161709568*y+5942585328756273/37778931862957161709568*x)/(1-893/1000*x)^(4663797269027135/144115188075855872)*(-(-220095752916899*y+220095752916899*x)/(1-893/1000*x)^(4663797269027135/144115188075855872))^(1/2)+(-1980861776252091/1125899906842624*x)^(3/2))/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*x^(1/2),x = 0 .. y)),y = 0 .. xl)-(436879227824847875/562949953421312+1037683545462388625/562949953421312*i)/(int(17827755986268819/75557863725914323419136*exp((-1980861776252091/1125899906842624*y)^(3/2))*220095752916899^(1/2)*y^(1/2)+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496*exp((-5942585328756273/37778931862957161709568*y+5942585328756273/37778931862957161709568*x)/(1-893/1000*x)^(4663797269027135/144115188075855872)*(-(-220095752916899*y+220095752916899*x)/(1-893/1000*x)^(4663797269027135/144115188075855872))^(1/2)+(-1980861776252091/1125899906842624*x)^(3/2))/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*x^(1/2),x = 0 .. y),y = 0 .. xl)+1))/(int((1-893/1000*y)/(int(17827755986268819/75557863725914323419136*exp((-1980861776252091/1125899906842624*y)^(3/2))*220095752916899^(1/2)*y^(1/2)+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496*exp((-5942585328756273/37778931862957161709568*y+5942585328756273/37778931862957161709568*x)/(1-893/1000*x)^(4663797269027135/144115188075855872)*(-(-220095752916899*y+220095752916899*x)/(1-893/1000*x)^(4663797269027135/144115188075855872))^(1/2)+(-1980861776252091/1125899906842624*x)^(3/2))/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*x^(1/2),x = 0 .. y),y = 0 .. xl)+1)*(17827755986268819/75557863725914323419136*exp((-1980861776252091/1125899906842624*y)^(3/2))*220095752916899^(1/2)*y^(1/2)+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496*exp((-5942585328756273/37778931862957161709568*y+5942585328756273/37778931862957161709568*x)/(1-893/1000*x)^(4663797269027135/144115188075855872)*(-(-220095752916899*y+220095752916899*x)/(1-893/1000*x)^(4663797269027135/144115188075855872))^(1/2)+(-1980861776252091/1125899906842624*x)^(3/2))/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*x^(1/2),x = 0 .. y)),x = 0 .. xl)+1/(int(17827755986268819/75557863725914323419136*exp((-1980861776252091/1125899906842624*y)^(3/2))*220095752916899^(1/2)*y^(1/2)+int(69952787413978063059109833042018715596190706139/5708990770823839524233143877797980545530986496*exp((-5942585328756273/37778931862957161709568*y+5942585328756273/37778931862957161709568*x)/(1-893/1000*x)^(4663797269027135/144115188075855872)*(-(-220095752916899*y+220095752916899*x)/(1-893/1000*x)^(4663797269027135/144115188075855872))^(1/2)+(-1980861776252091/1125899906842624*x)^(3/2))/(1-893/1000*x)^(4663797269027135/144115188075855872)*(1/(1-893/1000*x)^(4663797269027135/144115188075855872)*(y-x))^(1/2)*x^(1/2),x = 0 .. y),y = 0 .. xl)+1))

[ 本帖最后由 ChaChing 于 2010-3-15 15:04 编辑 ]
发表于 2006-11-19 15:57 | 显示全部楼层
很简单,用函数subs。

[ 本帖最后由 ChaChing 于 2010-3-15 13:56 编辑 ]
发表于 2006-11-19 16:04 | 显示全部楼层

回复

把你的问题贴一下吧,有点怀疑你的结果.
 楼主| 发表于 2006-11-19 16:20 | 显示全部楼层
这是源程序
帮我看看下,谢谢压。我无法整理得出地结果压。大家遇见国这种结果么?

function sys=slchenben(u)

digits(5);
beta=1.5;namda=13*exp(-2);gama=0.65*exp(-3);Ci=10;Cp=100;Cc=2000;

syms x y x1 x2 x3 m xl C
% f1 f2 f3 f4 f2_1 f2_2 f3_1 f3_2 f3_3 f4_1 f4_2 f4_3 f4_4 K K1 K2 K3 K31 K4 KK Hx Hy
tao=1-0.893*x;

F=1-exp((-(namda*(tao^(-gama))*x))^beta);
Fba=exp((-(namda*(tao^(-gama))*x))^beta);
Fba0=exp((-(namda*x))^beta);
f=namda*(tao^(-gama))*beta*(namda*(tao^(-gama))*x)^(beta-1)*exp((-(namda*(tao^(-gama))*x)^beta));
Hy=namda*beta*(namda*y)^(beta-1)*exp((-namda*y)^beta);
Hx=namda*beta*(namda*x)^(beta-1)*exp((-namda*x)^beta);

f1=namda*(tao^(-gama))*beta*(namda*(tao^(-gama))*(y-x))^(beta-1)*exp((-(namda*(tao^(-gama))*(y-x))^beta));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% f2_1=namda*(tao^(-gama))*beta*(namda*(tao^(-gama))*(x1-x))^(beta-1)*exp((-(namda*(tao^(-gama))*(x1-x))^beta));
% f2_2=namda*(tao^(-gama))*beta*(namda*(tao^(-gama))*(y-x1))^(beta-1)*exp((-(namda*(tao^(-gama))*(y-x1))^beta));
% f2=f2_1*f2_2;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% f3_1=namda*(tao^(-gama))*beta*(namda*(tao^(-gama))*(x1-x))^(beta-1)*exp((-(namda*(tao^(-gama))*(x1-x))^beta));
% f3_2=namda*(tao^(-gama))*beta*(namda*(tao^(-gama))*(x2-x1))^(beta-1)*exp((-(namda*(tao^(-gama))*(x2-x1))^beta));
% f3_3=namda*(tao^(-gama))*beta*(namda*(tao^(-gama))*(y-x2))^(beta-1)*exp((-(namda*(tao^(-gama))*(y-x2))^beta));
% f3=f3_1*f3_2*f3_3;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% f4_1=namda*(tao^(-gama))*beta*(namda*(tao^(-gama))*(x1-x))^(beta-1)*exp((-(namda*(tao^(-gama))*(x1-x))^beta));
% f4_2=namda*(tao^(-gama))*beta*(namda*(tao^(-gama))*(x2-x1))^(beta-1)*exp((-(namda*(tao^(-gama))*(x2-x1))^beta));
% f4_3=namda*(tao^(-gama))*beta*(namda*(tao^(-gama))*(x3-x2))^(beta-1)*exp((-(namda*(tao^(-gama))*(x3-x2))^beta));
% f4_4=namda*(tao^(-gama))*beta*(namda*(tao^(-gama))*(y-x3))^(beta-1)*exp((-(namda*(tao^(-gama))*(y-x3))^beta));
% f4=f4_1*f4_2*f4_3*f4_4;

K1=f1;
% K2=int(f2,x1,x,y);
% K3=int(int(f3,x2,x,x1),x1,x,y);
% K4=int(int(int(f4,x3,x,x2),x2,x,x1),x1,x,y);
K=K1*Hx;
KK=int(K,x,0,y);
% KK=vpa(int(int(Hx*K1,x,0,y),y,0,1));
My=Hy+KK;
% a=1/(1+int(My,y,0,m));
% by=My*a/(1-a);
c=int(My,y,0,xl);
a=1/(1+c);
by=a*My/(1-a);
% Et=int(My/c,y,0,xl);
% Ed=vpa(Et);
% sys=Ed;
Ei=1;
Ep=a*(exp((-(namda*xl))^beta)-a*exp((-(namda*0.893))^beta))+(1-a)*(int(exp((-(namda*(tao^(-gama))*(xl-y)))^beta)*by,y,0,xl)-int(exp((-(namda*(tao^(-gama))*(0.893-y)))^beta)*by,y,0,xl));
Ec=a*exp((-namda*0.893)^beta)+(1-a)*int(exp((-(namda*(tao^(-gama))*(0.893-y)))^beta)*by,y,0,xl);
Et=a+(1-a)*int((1-0.893*y)*by,y,0,xl);
Ecc=simple(Ec);
Epp=simple(Ep);
Ett=simple(Et);
% Eii=simple(Ei);
C=Ci*Ei/Ett+Cp*Epp/Ett+Cc*Ecc/Ett;
% char();
% str2num(C);
CC=char(C);
%  CCC=str2num(CC);
C1=vpa(CC)
% sys=CCC;

[ 本帖最后由 ChaChing 于 2010-3-15 14:57 编辑 ]
发表于 2006-11-19 18:45 | 显示全部楼层

回复

你还是没有描述你处理的问题是什么啊.
稍微描述一下吧,否则不好检查.
现在只能够从程序上猜猜而已.

用Matlab和 Mathematica都算了一下,没有显式解.
建议还是用数值积分算.

[ 本帖最后由 ChaChing 于 2010-3-15 14:59 编辑 ]
 楼主| 发表于 2006-11-20 08:43 | 显示全部楼层
哦,明白了,算的时候特别的慢,出来的结果就是我上面第一次发的结果那样了。问题的本身就一个看起来不是很难,但是编起来却出现了那么夺得问题。我一开始所有的变量都定义了符号型的,所以得到了符号型的表达式。还有一个程序是要调用这个结果,但那上面是数值型的,我转换不过去。并且我也看不懂我现在得出的结果。必须转换为数值积分么?能否具体指点一下啊。谢谢了。
发表于 2006-11-20 09:22 | 显示全部楼层
原帖由 Tla 于 2006-11-19 12:23 发表
可以考虑一下vpa&digits&subs&double等等函数的结合
这个方法应该可以的。
发表于 2006-11-20 12:17 | 显示全部楼层
就用subs,怎么会不行呢?给你一个例子。
syms x y
z=x^2+y^2;
z=subs(z,{x,y},{1,2});
最后得到的z就由符号型转换为数值型了
 楼主| 发表于 2006-11-20 19:10 | 显示全部楼层
哦,我再试试呀。谢谢大家的帮助呀。
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-11-3 01:38 , Processed in 0.077688 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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