필터 지우기
필터 지우기

unable to find symbolic solution

조회 수: 15 (최근 30일)
Dhananjay Singh
Dhananjay Singh 2020년 11월 23일
댓글: Dhananjay Singh 2020년 11월 23일
%heat conduction with an electrical heat source in copper wire
clc; clear;
close all;
%parameters
R = 0.2; % radius in m
L = 10; % length of wire in m
ke = 60000000; % electrical conductivity of copper in S/m
k = 401; % thermal conductivity of copper in W/m.K
I = 10; % electrical current in Amp
Se = (I*I)/ke; % rate of heat production per unit volume
T0 = 20 % Temp in Celcius
%Energy Balance in cylindrical shell of thickness del(r) and length L
% Doing the energy balance and taking del(r) common and limiting it to 0, a
% linear differential equation is formed.
% SOLVING DIFFERENTIAL EQUATION
syms q(r) %q is the heat flux
ode45 = diff(r*q,r) == Se*r
cond = q(0)~=Inf;%B.C at r = 0,q~=inf is invalid so we took it's value 0 to get similar answer
qSol(r)=dsolve(ode45,cond)
%Temperature Profile
syms T(r)
ode45 = diff(T,r) ==(-Se*r/(2*T))
cond = q(R)==T0;
TSol(r)=dsolve(ode45,cond)

채택된 답변

Stephan
Stephan 2020년 11월 23일
1.
The condition for the second ode is invalid - i assume you meant:
cond = T(R)==T0;
instead of
cond = q(R)==T0;
2.
As you stated by yourself in the code replace:
cond = q(0)~=Inf; %B.C at r = 0,q~=inf is invalid so we took it's value 0 to get similar answer
by
cond = q(0)==0; %B.C at r = 0,q~=inf is invalid so we took it's value 0 to get similar answer
3.
And finally i recommend to replace the variable ode45 by ode, because this can cause trouble due to an inbuilt function named ode45.
Making those changes worked well:
%heat conduction with an electrical heat source in copper wire
clc; clear;
close all;
%parameters
R = 0.2; % radius in m
L = 10; % length of wire in m
ke = 60000000; % electrical conductivity of copper in S/m
k = 401; % thermal conductivity of copper in W/m.K
I = 10; % electrical current in Amp
Se = (I*I)/ke; % rate of heat production per unit volume
T0 = 20 % Temp in Celcius
%Energy Balance in cylindrical shell of thickness del(r) and length L
% Doing the energy balance and taking del(r) common and limiting it to 0, a
% linear differential equation is formed.
% SOLVING DIFFERENTIAL EQUATION
syms q(r) %q is the heat flux
ode = diff(r*q,r) == Se*r
cond = q(0)==0;%B.C at r = 0,q~=inf is invalid so we took it's value 0 to get similar answer
qSol(r)=dsolve(ode,cond)
%Temperature Profile
syms T(r)
ode = diff(T,r) ==(-Se*r/(2*T))
cond = T(R)==T0;
TSol(r)=dsolve(ode,cond)
  댓글 수: 4
Dhananjay Singh
Dhananjay Singh 2020년 11월 23일
so is there any other method ? Please provide a code if possible.The requirement is to solve a differential equation: rdq/dr + q = Se*r with a condition that at r = 0 q ~= infinity.
Thank You
Dhananjay Singh
Dhananjay Singh 2020년 11월 23일
Also how do i now plot a graph of qSol(r) wrt r ?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Number Theory에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by