Question

Use python code to solve IVP. Code must print both general and particular solutions. Please paste...

Use python code to solve IVP. Code must print both general and particular solutions. Please paste full python code for your answer. IVP: y′=(5x^2)(y^2)+(125x^2), y(−7π)=10

Below is an example of code for the problem 7x″−3x′−57x=0, x(2π)=9, x′(−π)=5exp(3) :

from sympy import *
y = symbols('y')
x = Function('x')
x = dsolve(7*diff(x(y),y,2)-3*diff(x(y),y)-57*x(y),x(y))
print('The general solution is: ',x,'.',sep='')
x = x.rhs
xp = diff(x,y)
y0, y0p = 2*pi, -pi
x0, x0p = 9, 5*exp(3)
x0LHS, x0pLHS = x.subs(y,y0) - x0, xp.subs(y,y0p) - x0p

C1, C2 = symbols('C1 C2')
C = solve([x0LHS,x0pLHS],[C1,C2])
print('The particular solution is: x = ',x.subs(C).evalf(),'.',sep='')

Homework Answers

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT