# Difficulty solving some second order differential equations

I have trouble finding 10% and 90% of the rise time in a second order differential equation.

I have tried to search but i have not solved my issue, so now i ask here.

I have added the code to aleph.sagemath.org however the link is crazy long so i put it in a short link: http://bit.utoft.org/138hfAz

The code is also on pastebin http://pastebin.com/4hwdLJuT

Cheers J. Utoft

edit retag close merge delete

Sort by ยป oldest newest most voted

Concerning your first issue, instead of the symbolic solve() approach, you can use a numerical approach using the find_root() function:

sage: find_root(diff(specificSolution,t),1e-6,5e-6)
3.6275987337046833e-06

This approach also works for your second issue:

sage: find_root(specificSolution-Vin*0.1,0,1)
4.882292726784699e-07

Hence, you can check:

sage: Vout,t = var("Vout,t")
sage: L = 1e-3
sage: C = 1e-9
sage: Vin = 5
sage: R = 1e3
sage: Vout = function("Vout",t)
sage: equation = L*C*diff(Vout,t,2) + R*C*diff(Vout,t) + Vout == Vin
sage: specificSolution = desolve(equation,Vout,ivar=t,ics=[0,0,0])
sage: Max = find_root(diff(specificSolution,t),1e-6,5e-6)
sage: M10 = find_root(specificSolution-Vin*0.1,0,1)
sage: M90 = find_root(specificSolution-Vin*0.9,0,1)
sage: plotMax = 2e-5
sage: plot1 = plot(specificSolution,[t,0,plotMax],rgbcolor=[0,0,0])
sage: plot1 += plot(Vin*0.1,[t,0,plotMax],rgbcolor=[0,0,1]) #10% line
sage: plot1 += plot(Vin*0.9,[t,0,plotMax],rgbcolor=[0,1,0]) #90% line
sage: plot1 += plot(specificSolution(t=Max),[t,0,plotMax],rgbcolor=[1,0,0])
sage: plot1 += line([(Max,0),(Max,6)],rgbcolor=[1,0,0])
sage: plot1 += line([(M10,0),(M10,6)],rgbcolor=[0,0,1])
sage: plot1 += line([(M90,0),(M90,6)],rgbcolor=[0,1,0])
sage: plot1

Which looks correct.

more

Thank you so much. I can finally get my work done :) Is there a specific reason that it does not work with symbolic operations

( 2013-05-31 09:27:23 -0600 )edit

Well i guess it is harder to find a formula than approximation of a number.

( 2013-05-31 10:01:50 -0600 )edit