how do i solve this equation using matlab
조회 수: 6 (최근 30일)
이전 댓글 표시
T(x,y,z,t)=\frac{2\times A\times P_\max\times\sqrt\alpha}{k\times\pi^\frac{2}{3}\times r^2}\int_0^{\sqrt t}\times\frac{1}{1+\frac{4\times\alpha\times u^2}{r^2}} \times\exp (\frac{-x^2-y^2}{r^2+4\times\alpha\times u^2}-\frac{z^2}{4\times\alpha\times u})du
ive created my equation using latex but i am not sure how to write a script to solve for T and plot a temperature time graph. some guidance would be appreciated.
댓글 수: 3
John D'Errico
2023년 3월 4일
It seems to have some errors in it. At least LaTeX did not seem to like what it saw on my computer. It is difficult to write MATLAB code for something if you cannot even show the problem you want to solve.
So if you want help, then you need to make it possible to help you.
Rik
2023년 3월 9일
I recovered the removed content from the Google cache (something which anyone can do). Editing away your question is very rude. Someone spent time reading your question, understanding your issue, figuring out the solution, and writing an answer. Now you repay that kindness by ensuring that the next person with a similar question can't benefit from this answer.
답변 (1개)
Torsten
2023년 3월 4일
이동: Torsten
2023년 3월 4일
T = @(x,y,z,t) 2*A*P_max*sqrt(alpha)/(k*pi^(2/3)*r^2)*integral(@(u)1./(1+4*alpha*u.^2/r^2).*exp(-(x^2+y^2)./(r^2+4*alpha*u.^2)-z^2./(4*alpha*u),0,sqrt(t))
댓글 수: 7
Torsten
2023년 3월 4일
tic
x=1;
y=1;
z=1;
A = 1;
P_max = 1;
r = 1;
k = 1;
alpha = 1;
T = @(x,y,z,t) 2*A*P_max*sqrt(alpha)/(k*pi^(2/3)*r^2)*integral(@(u)1./(1+4*alpha*u.^2/r^2).*exp(-(x^2+y^2)./(r^2+4*alpha*u.^2)-z^2./(4*alpha*u)),0,sqrt(t))
t_upper = 3;
t = linspace(0, t_upper, 250);
T_num = arrayfun(@(t) T(x,y,z,t),t)
plot(t,T_num)
toc
Torsten
2023년 3월 4일
how can i change the integration limits so that it could be sqrt ( time minus a constant)
By defining the constant before defining the function handle T and changing "sqrt(t)" in the definition of T to whatever you like as upper limit of integration.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!






