boundary value problem

12 views
Skip to first unread message

Isaque Soares

unread,
Apr 27, 2020, 5:22:27 AM4/27/20
to sympy
Does anyone knows how to solve a ode on sympy with this kind of bvp?

imagem1.png


50𝑣(𝑥)+1000𝑑4𝑑𝑥4𝑣(𝑥)=3
50𝑣(𝑥)+1000𝑑4𝑑𝑥4𝑣(𝑥)=3

Oscar Benjamin

unread,
Apr 27, 2020, 6:02:53 AM4/27/20
to sympy
You can use dsolve for boundary value problems you just have to give the boundary conditions as the ICs argument e.g.:


In [27]: f = Function('f')                                                                                                                     

In [28]: t = Symbol('t')                                                                                                                    

In [29]: dsolve(f(t).diff(t, 2)-f(t))

Out[29]: 

           -t       t

f(t) = C₁⋅ℯ   + C₂⋅ℯ 


In [30]: dsolve(f(t).diff(t, 2)-f(t), ics={f(0):0, f(1):0})               

Out[30]: f(t) = 0


In [31]: dsolve(f(t).diff(t, 2)-f(t), ics={f(0):0, f(1):1})

Out[31]: 

            t          -t   

                          

f(t) = ───────── - ─────────

       2⋅sinh(1)   2⋅sinh(1)


--
Oscar
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/2b9ec46d-a049-4bf8-b24b-e4cc17742928%40googlegroups.com.
Message has been deleted

Isaque Soares

unread,
Apr 27, 2020, 5:21:55 PM4/27/20
to sympy
But how do I pass a constraint that is a function value that I don't know about yet to the ics dictionary? I mean the second constraint.

Oscar Benjamin

unread,
Apr 27, 2020, 5:29:33 PM4/27/20
to sympy
It doesn't look like dsolve can do that. I think it's worth opening an
issue on github for that.

To solve your problem right now you can set up the IC equations using
the general solution and solve for the constants with solve.

--
Oscar

On Mon, 27 Apr 2020 at 22:21, Isaque Soares <isaque...@gmail.com> wrote:
>
> But how do I pass a constraint that is a function value that I don't know about yet to the ics dictionary? I mean the second constraint.
>
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/61147b35-d06f-402e-a669-764248ab2611%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages