| 查看: 555 | 回复: 5 | |||
| 当前主题已经存档。 | |||
| 当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖 | |||
[交流]
【求助】matlab模拟公式
|
|||
|
我想模拟附件中的公式,下面是我写的程序 clc close all; syms xi eta tau ; a=1; tau=1; c=1500; rho=1000; N=100; %t=[0:1:1]; x=0; xi=300; eta=300; p1=zeros(N,1); %采样点数 f=zeros(N,1); %xi eta粘滞 rho密度 tau 脉宽 omega=sqrt(4*a^2*c.^2-a^4*((xi+(4*eta/3))/rho)^2); f(t)=tau*exp(-((t/pi).^2))/sqrt(pi); s(t)=diff(f)-((xi+(4*eta/3))/rho)*diff(f,2); for t=1:N p1(t)=exp(-(a^2)*((xi+(4*eta/3))/rho)*t)*sin(omega*t-a*x)/(2*omega); p(t)=conv(p1(t),s(t)); end plot(p) 报错如下 ??? Error using ==> unknown Matrix dimensions must agree. Error in ==> viscosityl at 18 s(t)=diff(f)-((xi+(4*eta/3))/rho)*diff(f,2); 请高手帮忙改正,谢谢 |
» 猜你喜欢
确定了,国自然21号放榜
已经有4人回复
静等基金结果
已经有16人回复
filecode
已经有6人回复
我的国基提前知道中了,可是同事的操作让我实在接受不了,怎么会有这样的人
已经有11人回复
关于Filecode分析方法
已经有3人回复
国自然结果
已经有8人回复
FileCode能看出啥?
已经有8人回复
应该是93bebmhtak前后十一个字符比较关键
已经有22人回复
奇怪,两个人的filecode固定段从头到尾一模一样
已经有4人回复
8月时间戳变的,举个手。玩一下,释放压力
已经有13人回复
5楼2009-04-26 11:07:36
hitzhang
木虫 (正式写手)
- 仿真EPI: 1
- 应助: 0 (幼儿园)
- 贵宾: 2.15
- 金币: 1356.7
- 散金: 969
- 红花: 8
- 帖子: 863
- 在线: 226.5小时
- 虫号: 390575
- 注册: 2007-06-02
- 性别: GG
- 专业: 无机非金属类电介质与电解
★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★
woshilsh(金币+4,VIP+0):常来,吼吼 4-25 13:42
loulou85(金币+10,VIP+0): 4-25 15:43
woshilsh(金币+4,VIP+0):常来,吼吼 4-25 13:42
loulou85(金币+10,VIP+0): 4-25 15:43
|
>> a=1; tau=1; c=1500; rho=1000; N=100; t=linspace(0,1,100); x=0; xi=300; eta=300; p1=zeros(N,1); %采样点数 f=zeros(N,1); %xi eta粘滞 rho密度 tau 脉宽 omega=sqrt(4*a^2*c.^2-a^4*((xi+(4*eta/3))/rho)^2); f=tau*exp(-((t/pi).^2))/sqrt(pi);d1=diff(f);d2=diff(f,2); s=d1(1 end-1))-((xi+(4*eta/3))/rho)*d2;for t=1 N-2)p1(t)=exp(-(a^2)*((xi+(4*eta/3))/rho)*t)*sin(omega*t-a*x)/(2*omega); p(t)=p1(t)*s(t); end >> plot(p) >> |
2楼2009-04-25 12:36:47
3楼2009-04-25 15:49:08
hitzhang
木虫 (正式写手)
- 仿真EPI: 1
- 应助: 0 (幼儿园)
- 贵宾: 2.15
- 金币: 1356.7
- 散金: 969
- 红花: 8
- 帖子: 863
- 在线: 226.5小时
- 虫号: 390575
- 注册: 2007-06-02
- 性别: GG
- 专业: 无机非金属类电介质与电解
4楼2009-04-25 19:06:52










回复此楼
end-1))-((xi+(4*eta/3))/rho)*d2;
100