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,




g[1] := (diff(a(t), t))/(t^2-1) = 1;
g[2] := (diff(a(t), t))*(diff(b(t), t)) = 1;
dsolve({eq2, eq3});
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.




dt := 2.07*0.254e-1



dto := 2.38*0.254e-1



ho := 5000




Ltube := 5




Po := 2.5



To := 350



dp := 0.3e-2



tau := 3



dpore := 5.2*10^(-9)



kfluid := 0.485e-1



ksolid := 1.67



kpipe := 17



Cpair := 1.01



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



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




Rgas := 8.2057*10^(-5)





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


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




Volumetric flow, m^3/s






Superficial velocity, m/s


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



Gs constant, kg/m^2-s

Error, missing operator or `;`


Gsi := `ρi`*Vsi



Gs := 1.45






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)




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



kinetic parameter

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



radial disperssion Coeff

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



thermal conductivity calculations

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




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



KB := Kbs+Kbd



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



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



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



`ΔHrxn` := Hfacrolein-Hfwater-Hfpropylene



Solving nodified Ergun Equation

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




Determining U of the wall and Ueffective



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




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



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)


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


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

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


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

Cprop(0) = 0.3e-1


Ics2 := T(0) = 350

T(0) = 350


Ics3 := P(0) = 2.5

P(0) = 2.5



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]





`` i can dsolve couple linear equations with power series solutions or taylor series expantion?

file attached below.


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:




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)


Please, help me!


Thank you so much!

Hai everyone

may i ask why solution have an error?

hope i have an answer






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)


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


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))


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))


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


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









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


 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.



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') ...




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

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