코드 확인하고 행렬 관계

1 回表示 (過去 30 日間)
joonyoung Go
joonyoung Go 2019 年 11 月 17 日
回答済み: Mahesh Taparia 2019 年 11 月 20 日
올린 파일과 아래의 코드가 맞는지 궁금합니다.행렬간의 관계에 대하여 알고 싶습니다.
qo=3900
a=0.13.*10.^(-7)
k=0.456
x=0.01
Ti=25
t=0:1:1000
T=2.*qo.*(sqrt(a.*t./pi)./k).*exp(-x.^2./(4.*a.*t))-qo.*x./k.*erfc(x./(2.*sqrt(a.*t)))+Ti
plot(t,T)
올린 파일과 위의 코드가 맞는지 궁금합니다.

採用された回答

Mahesh Taparia
Mahesh Taparia 2019 年 11 月 20 日
Hi Joonyoung
As per your code, you are ploting T(t) with x=0.01. You are correct if you want to plot at constant value of x which is 0.01 in your case.
But if you want to plot T(x,t), then you should vary x and t both. Consider the below code:
qo=3900
a=0.13.*10.^(-7) ;
k=0.456 ;
x=0:0.01:10; %% Varying x with t
Ti=25 ;
t=0:1:1000 ;
T=2.*qo.*(sqrt(a.*t./pi)./k).*exp(-x.^2./(4.*a.*t))-qo.*x./k.*erfc(x./(2.*sqrt(a.*t)))+Ti;
plot3(t,x,T)
Korean Version (Using Google Translate):
안녕 준영
코드에 따라 x = 0.01로 T (t)를 플로팅합니다. 귀하의 경우 0.01의 상수 값 x로 플롯하려면 올바른 것입니다.
그러나 T (x, t)를 플로팅하려면 x와 t를 모두 바꿔야합니다. 아래 코드를 고려하십시오.
qo=3900
a=0.13.*10.^(-7) ;
k=0.456 ;
x=0:0.01:10; %% t에 따라 x가 변함
Ti=25 ;
t=0:1:1000 ;
T=2.*qo.*(sqrt(a.*t./pi)./k).*exp(-x.^2./(4.*a.*t))-qo.*x./k.*erfc(x./(2.*sqrt(a.*t)))+Ti;
plot3(t,x,T)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGoogle についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!