how do i solve this equation using matlab
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
John D'Errico
le 4 Mar 2023
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
le 9 Mar 2023
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.
Réponses (1)
Torsten
le 4 Mar 2023
Déplacé(e) : Torsten
le 4 Mar 2023
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 commentaires
Torsten
le 4 Mar 2023
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
le 4 Mar 2023
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.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!






