mayzal

25 Reputation

One Badge

0 years, 328 days

MaplePrimes Activity


These are questions asked by mayzal

I’m trying to solve a stiff system 1-D PDEs numerically in Maple but I’m getting the following error:

“Error, (in pdsolve/numeric/match_PDEs_BCs) cannot handle systems with multiple PDE describing the time dependence of the same dependent variable, or having no time dependence”

I included a picture of the PDEs and their BCs in the attached maple file. For easy reading, the attached file includes highlighted sections for parameters and variables. You can skip those to PDEs, BCs and ICs sections at the end of the document to reach the error I’m facing.

For reference, I used another software to solve the system and I was able to get the results in few seconds, so I think it is solvable. However, personally I prefer to use Maple so any inputs, insights, workarounds that I could use to handle the system in Maple would be of great help to me. Thank you.

question.mw

I'm trying to solve system of ODE (Temperature changing with time) which are going to use the heat capacity obtained from thermophysical package (heat capacity is changing with temperature).

In the support page there is an example in which they were able to integrate the heat capacity from the package. So I wondering if it is possible to include it in an ODE system.

I used their same approach, I tried defining the call to the package as a function but I'm getting an error:

"Error, (in dsolve/numeric/process_input) input system must be an ODE system, found {ThermophysicalData:-CoolProp:-PropsSI(C,P,101325,T,T1(t),"hydrogen"), T1(t), T2(t), T3(t)}"

Attached question.mw

restart:
with(ThermophysicalData):
with(CoolProp):
with(plots):

#I would like to get the heat capacity from this package. Heat capacity is a function of temperature and pressure.
CP:=T1->PropsSI(C, P, 101325, T, T1, "hydrogen")/10000:

#Parameters
UA:=10:T0:=20:TS:=250:W:=100:M:=1000:

#The temperature is changing in this system of ODE with time. I would like to have the heat capacity value changing with temperature using the values obtained from the package.
EQ1:=diff(T1(t),t)=(W*CP(T1(t))*(T0-T1(t))+UA*(TS-T1(t)))/M/CP(T1(t)):
EQ2:=diff(T2(t),t)=(W*CP(T1(t))*(T1(t)-T2(t))+UA*(TS-T2(t)))/M/CP(T1(t)):
EQ3:=diff(T3(t),t)=(W*CP(T1(t))*(T2(t)-T3(t))+UA*(TS-T3(t)))/M/CP(T1(t)):

sol:=dsolve({EQ1,EQ2,EQ3,T1(0)=25,T2(0)=25,T3(0)=25},[T1(t),T2(t),T3(t)],numeric):
odeplot(sol,[[t,T1(t)],[t,T2(t)],[t,T3(t)]],t=0..140,legend=[T1,T2,T3],labels = ["time [min]", "Ti [C]"],axes=boxed)
sol(57.7);

I am a new Maple user. I have a system of differential equations and I want Maple to solve the system such that if one of the solutions (dependent variable) is larger than a certain value, one of the differential equation will be described in a different way. I will describe it with an example:

restart;
with(plots);
# imagine we have two differential equations:
eqn1 := diff(T(x), x) = x + T(x)/10 + q(x)/2;
eqn2 := diff(q(x), x) = T(x)^2/10 + 3*q(x);
#The solution is given by:
sol := dsolve({eqn1, eqn2, T(0) = 0, q(0) = 0}, {T(x), q(x)}, numeric, method = mebdfi);
odeplot(sol, [x, T(x)], x = 1 .. 3);

#what I want to do is to write a conditional differential equation that depends on the solution T(x) of the system. For exmaple, if the value of T(x) is larger than 4, the solver sould use a different equation to solve the system. Say for example instead of eqn1 it will use something else like: eqn1:=diff(T(x),x)=x+T(x)^2/200+q(x)/300.

#Internally after each iteration, the solver should check the value of the solution T(x), and depending on it it will choose a different differential equation to use in the next step x.

I tried defining the differential equation as piecewise but I was not successful.

Page 1 of 1