Items tagged with dsolve dsolve Tagged Items Feed

Hello all,

I have an ODE system (please see bellow) where my unknowns are S(t) and K(t), all the the other symbols are known parameters. This system, by given the initial values for S and K, that is, S(0)=100 and K(0)=20, I can solve numerically.

sys:= diff(S(t), t) = -eta*K(t)*S(t)/(w*N*(S(t)+K(t))), diff(K(t), t) = eta*K(t)*S(t)/(w*N*(S(t)+K(t)))+S(t)*(-z*eta*alpha*K(t)^2+(-z*eta*alpha*S(t)-(eta*alpha^2*S(t)^2-2*N*C[max]*w*eta*alpha*K(t)+((-N*w+z)*alpha+N*C[max]^2*w*eta)*w*N)*upsilon)*K(t)+N*S(t)*w*alpha*upsilon*(N*w-z))/((K(t)^2*alpha*z+3*K(t)*S(t)*alpha*z+(2*S(t)*z*alpha+upsilon)*S(t))*w*N)

In addition, I have an algebraic equation:

eq1:= -c2 + (K(t2)*S(t2)+w*N*S(t2))*z=0,

where S(t2) and K(t2) are the solutions of my ODE sys in S and K at t=t2. The t2 is unknown time variable. 

My question is: how can I find t2 such that my algebraic equation (eq1) is satisfied.

Thanks in advance,

Dmitry

 

 

g[1] := (diff(a(t), t))/(t^2-1) = 1;
g[2] := (diff(a(t), t))*(diff(b(t), t)) = 1;
dsolve({eq2, eq3});
with(DynamicSystems):
sys := DiffEquation([g[1]=1, g[2]=1], inputvariable = [b(t)], outputvariable = [a(t), b(t)]):
ts := 0.1:
t_sim := 10.0:
#in_t := Sine(1, 1, 0, 0):
#in_z := Sine(1, 1, 0, 0, samplecount = round(t_sim/ts), sampletime = ts, discrete):
in_t := t:
sol := Simulate(sys, [in_t]):
p1 := plots[odeplot](sol, [[t, a(t)]], t = 0 .. t_sim, numpoints = 200, color = red):
Error, (in DEtools/convertsys) unable to convert to an explicit first-order system
Error, (in plots/odeplot) input is not a valid dsolve/numeric solution

So im trying to solve multiple ODES using dsolve(numeric) but I jsut cant get it to work.

I kep getting this one error: 

Error, (in f) unable to store '-HFloat(0.020918994979034728)-HFloat(0.09184018333019917)*I' when datatype=float[8]

 

This is my uploaded file 

(for some reason the uploaded file didnt show the error at the bottom so i just pasted it in the spot it would appear.

Download CHE504_HW5.mw

Given:

restart

dt := 2.07*0.254e-1

0.52578e-1

(1)

dto := 2.38*0.254e-1

0.60452e-1

(2)

ho := 5000

5000

(3)

``

Ltube := 5

5

(4)

``

Po := 2.5

2.5

(5)

To := 350

350

(6)

dp := 0.3e-2

0.3e-2

(7)

tau := 3

3

(8)

dpore := 5.2*10^(-9)

0.5200000000e-8

(9)

kfluid := 0.485e-1

0.485e-1

(10)

ksolid := 1.67

1.67

(11)

kpipe := 17

17

(12)

Cpair := 1.01

1.01

(13)

`μ_air` := 3.16*10^(-5)

0.3160000000e-4

(14)

rho := P(z)*(28.9*(1/1000))/(Rgas*(T(z)+273.15))

0.2890000000e-1*P(z)/(Rgas*(T(z)+273.15))

(15)

``

Rgas := 8.2057*10^(-5)

0.8205700000e-4

(16)

``

``

density calculation n/v = (P/RT)*mw_air, kg/m^3

``

`ρi` := (2.5*28.966)/(0.82057e-1*(350+273.15))

1.416186012

(17)

NULL

Volumetric flow, m^3/s

((1/60)*((1/300)*((1/1000)*(180*1000000)*.4535)*(1/24))*(1/60))/(1.416)

0.2224085844e-2

(18)

``

NULL

Superficial velocity, m/s

NULL

Vsi := evalf(%/((1/4)*Pi*(2.07*0.254e-1)^2))

1.024362190

(19)

Gs constant, kg/m^2-s

Error, missing operator or `;`

 

Gsi := `ρi`*Vsi

1.450687405

(20)

Gs := 1.45

1.45

(21)

``

``

NULL

Void fraction, epsilon,b

`εb` := .38+0.73e-1*(1+(0.525e-1/(0.3e-2)-2)^2/(0.525e-1/(0.3e-2))^2)

.5102677551

(22)

hi

hi := 3.6*kfluid*(dp*Gs/(`μ_air`*`εb`))^.365/dp

448.9928888

(23)

kinetic parameter

K := ln(19.837-13636/(T(z)+273.15))

ln(19.837-13636/(T(z)+273.15))

(24)

radial disperssion Coeff

Dr := Vs*dp/(9*(1+19.4*(dp/dt)^2))

0.3135309899e-3*Vs

(25)

thermal conductivity calculations

Kbs := kfluid*(`εb`+(1-`εb`)/(2/3*(1+kfluid/ksolid)))

0.5937050269e-1

(26)

``

Kbd := `εb`*Cpair*Gs*dp/(9*(1+19.4*(dp/dt)^2))

0.2342976727e-3

(27)

KB := Kbs+Kbd

0.5960480036e-1

(28)

Heat of reaction (deltaH), Find heat of formation for each reactant and product--> dHrxn = heat of formation(product)-heat of formation(reactant)

Error, missing operator or `;`

 

heat of formation = A + B*T + C*T^2

Hfacrolein := -7.076*10+(-5.59*10^(-2))*(273.15+350)+3.86*10^(-5)*(273.15+350)^2

-90.60509039

(29)

Hfwater := -238.41-0.122e-1*(350+273.15)+2.76*10^(-6)*(273.15+350)^2

-244.9406781

(30)

Hfpropylene := 3.62*10+(-6.49*10^(-2))*(273.15+350)+3.049*10^(-5)*(273.15+350)^2

7.59731748

(31)

`ΔHrxn` := Hfacrolein-Hfwater-Hfpropylene

146.7382702

(32)

Solving nodified Ergun Equation

f := (1-`εb`)*(1.75+(150*(1-`εb`))*`μ_air`/(dp*Gs))/`εb`

2.191735176

(33)

``

Determining U of the wall and Ueffective

``

``

Uwall := 1/(1/hi+ln(dto/dt)/(2*ksolid)+1/ho)

22.61972270

(34)

``

Ueff := 1/(1/Uwall+(1/2)*dt/(4*KB))

6.473624190

(35)

ode1 := Gs*(diff(Cprop(z), z))/rho = -K*Cprop(z)

0.4117046714e-2*(T(z)+273.15)*(diff(Cprop(z), z))/P(z) = -ln(19.837-13636/(T(z)+273.15))*Cprop(z)

(36)

ode2 := Gs*Cpair*(diff(T(z), z)) = -K*Cprop(z)*`ΔHrxn`-4*Ueff*(T(z)-350)/dt

1.4645*(diff(T(z), z)) = -146.7382702*ln(19.837-13636/(T(z)+273.15))*Cprop(z)-492.4968000*T(z)+172373.8800

(37)

ode3 := diff(P(z), z) = -f*Gs^2/(rho*dp)

diff(P(z), z) = -4.361346783*(T(z)+273.15)/P(z)

(38)

Ics1 := Cprop(0) = 0.3e-1

Cprop(0) = 0.3e-1

(39)

Ics2 := T(0) = 350

T(0) = 350

(40)

Ics3 := P(0) = 2.5

P(0) = 2.5

(41)

NULL

dsolve({Ics1, Ics2, Ics3, ode1, ode2, ode3}, {Cprop(z), P(z), T(z)})

Error, (in f) unable to store '-HFloat(0.020918994979034728)-HFloat(0.09184018333019917)*I' when datatype=float[8]

 

 

NULL

NULL

``

hi.how i can dsolve couple linear equations with power series solutions or taylor series expantion?

file attached below.

thanks

 

TAYLOR.mw

I have some differential equations that I want to plot on the same axis (as i have below), but would like to plot with a log scale to illustrate the fact that one is simply a logarithmic decay (solid line) and all the others are not.

I had used deplot and display to make the above graph,

but if you want more detail, here is a worksheet with the relevant differntial equations:
MaplePrimesGraphUpload.mw

 

 

 

Hi everyone!

I tried to plot the solution of the following ode, but I only got the message error:

Warning, cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up

(file attached)

Problem.mw

https://dl.dropboxusercontent.com/u/66502600/Problem.mw

 

Please, help me!

 

Thank you so much!

Hai everyone

may i ask why solution have an error?

hope i have an answer

r

 

NULL

restart

with(plots):

Pr := 6.8:

Eq1 := (101-100*lambda)*(diff(f(eta), `$`(eta, 3)))+f(eta)*(diff(f(eta), `$`(eta, 2)))+2*delta*theta(eta)+2*delta*Nc*gamma(eta)-2*delta*Nr*phi(eta);

(101-100*lambda)*(diff(diff(diff(f(eta), eta), eta), eta))+f(eta)*(diff(diff(f(eta), eta), eta))+2*theta(eta)+2*gamma(eta)-2*phi(eta)

(1)

Eq2 := (101-100*lambda)*(diff(theta(eta), `$`(eta, 2)))+Pr*f(eta)*(diff(theta(eta), eta))+Pr*Nb*(diff(theta(eta), eta))*(diff(phi(eta), eta))+Pr*Nt*(diff(theta(eta), eta))^2;

(101-100*lambda)*(diff(diff(theta(eta), eta), eta))+6.8*f(eta)*(diff(theta(eta), eta))+3.40*(diff(theta(eta), eta))*(diff(phi(eta), eta))+3.40*(diff(theta(eta), eta))^2

(2)

Eq3 := (101-100*lambda)*(diff(phi(eta), `$`(eta, 2)))+Le*f(eta)*(diff(phi(eta), eta))+Nt*(diff(theta(eta), `$`(eta, 2)))/Nb;

(101-100*lambda)*(diff(diff(phi(eta), eta), eta))+.1*f(eta)*(diff(phi(eta), eta))+1.000000000*(diff(diff(theta(eta), eta), eta))

(3)

Eq4 := (101-100*lambda)*(diff(gamma(eta), `$`(eta, 2)))+Sc*s*(diff(theta(eta), `$`(eta, 2)))+Sc*f(eta)*(diff(gamma(eta), eta));

(101-100*lambda)*(diff(diff(gamma(eta), eta), eta))+.30*(diff(diff(theta(eta), eta), eta))+.6*f(eta)*(diff(gamma(eta), eta))

(4)

VBi := [10, 20, 30]:

etainf := 5:

bcs := f(0) = 0, (D(f))(0) = 0, (D(theta))(0) = -Bi*(1-theta(0)), phi(0) = 1, gamma(0) = 1, (D(f))(etainf) = 1, theta(etainf) = 0, phi(etainf) = 0, gamma(etainf) = 0;

f(0) = 0, (D(f))(0) = 0, (D(theta))(0) = -Bi*(1-theta(0)), phi(0) = 1, gamma(0) = 1, (D(f))(5) = 1, theta(5) = 0, phi(5) = 0, gamma(5) = 0

(5)

dsys := {Eq1, Eq2, Eq3, Eq4, bcs}:

for i to 3 do Bi := VBi[i]; dsol[i] := dsolve(dsys, numeric, continuation = lambda); print(Bi); print(dsol[i](0)) end do

Error, (in dsolve/numeric/bvp) cannot determine a suitable initial profile, please specify an approximate initial solution

 

NULL

NULL

 

Download soret.mw

 

 

 



thanks. I played around, and had problems implementing your ideas for one of the systems I'm interested in.I don't see a difference between this and what you had advised me on, but it gets an error.

any idea why?
or how to fix it?

thing1 := diff(B[1](t), t) = piecewise(t <= 500, 0.3e-2-(63/10000)*B[1](t)-(3/500)*B[2](t), -(3/10000)*B[1](t)):
thing2 := diff(B[1](t), t) = piecewise(t <= 500, 0.1e-1-(1/50)*B[1](t)-(13/625)*B[2](t), -(1/1250)*B[2](t)):
sol := dsolve({thing1, thing2, B[1](0) = 0, B[2](0) = 0}, {B[1](t), B[2](t)}, numeric, output = listprocedure); plots:-odeplot(sol, [B[1](t), B[2](t)], t = 450 .. 550);

Error, (in dsolve/numeric/DAE/explicit) unable to obtain the standard form of the DAE system due to the presence of leading dependent variables/derivatives in the piecewise: piecewise(t <= 500, 1/100-(1/50)*B[1](t)-(13/625)*B[2](t), -(1/1250)*B[2](t))-piecewise(t <= 500, 3/1000-(63/10000)*B[1](t)-(3/500)*B[2](t), -(3/10000)*B[1](t))
Error, (in plots/odeplot) curve is not fully specified in terms of the ODE solution, found additional unknowns {B[1](t), B[2](t)}


hi.please help me for solve this equations

thanks...

Tur.mw

 Can anyone explain me how to use the next feature that you can find in ?dsolve,numeric,events,Round-off and simple triggers or refer me to a previous answer that explain this:

   This is primarily desired to be able to apply events for an ODE system that has been separated into disjoint cases dependent on the values of particular triggers (in which case you always want to use a form that provides the values just past the trigger point).

 Specially how to separate the ODE system into disjoint cases. Thanks in advanced.

Hi,

 

I have an issue calculating an electronics circuit with Maple, using units. I have a current source that I know, and I want to determin the voltage in a capacitor by solving an ODE (except that the current source is defined piecewise). And to make sure I have all the units and scales right, I use the standard unit package. All my variables have their units defined.

Except that Maple doesn't want to solve the equation. It seems to me that it assumes that the function I am trying to solve is unitless, and therefore refuses to solve. 

V__out := 3*Unit('kV');

C__out := 2*Unit('nF');
R__blead := 520*Unit('`k&Omega;`');

I__fly := proc (t) options operator, arrow; Unit('A')*piecewise(t < 3.25*Unit('us'), (1+(-1)*t/(3.25*Unit('us')))*.2, 0) end proc;

 

dsolve({I__fly(t*Unit('s'))-V__C(t*Unit('s'))/R__blead = C__out*(diff(V__C(t*Unit('s')), t)), V__C(0*Unit('s')) = V__out}, V__C(t*Unit('s')));
Error, (in Units:-Standard:-+) the units `A` and `S` have incompatible dimensions

 

Is there a way to make Maple assume the unit of what it's trying to solve ? I need it to understands that V__C is in Unit('V') ...

 

Thanks

 

hi .by changing amount of variable such as '' f '' or 'D5 ' in input data, not changing  in final result!!!!please chek attached file 

thanksX4.mw

Can somebody help me to find the solution?

I think there is something wrong with the definition of bvw1. If I use dsolve (in soln) with only bvw as Initial Condition,

I get a solution but if I also insert bvw1 as an Initial condition soln won't appear.

Here's what's written in the image:

'Imagine the course of a planet around a star with L=0.5 and e=0.7'

Solve Keppler's differential equation with Initial Conditions:'

1 2 3 4 5 6 7 Last Page 1 of 27