- #1
damightytom
- 17
- 0
1. Solve the differential equation
y=10, dy/dx=0 when x=0
z=15, dz/dx=0 when x=0
d2y/dx2 = - 2y/3 + (z – y)/3
d2z/dx2 = -(z – y)
plot y,z,dydx,dzdx doe x=0->10
I am having trouble getting my head around the problem.
I need help setting a variable for dy/dx and dz/dx in my function for ODE45 to find the value.
So after setting up my script as such
[y z] = ode45('fun',[0 10], vekt);
vekt being the vector for all values at x=0
I need to set up my function so ODE has something to work with.
I know what to do when I have d/dx in the equation since you can set dy/dx = z and then d2y/dx2 = y'. But now I have a value for dydx at x=0 but I don't have that in the equation.
So I'm at a loss.
Anyone can give me any pointers?
y=10, dy/dx=0 when x=0
z=15, dz/dx=0 when x=0
d2y/dx2 = - 2y/3 + (z – y)/3
d2z/dx2 = -(z – y)
plot y,z,dydx,dzdx doe x=0->10
Homework Equations
I am having trouble getting my head around the problem.
I need help setting a variable for dy/dx and dz/dx in my function for ODE45 to find the value.
The Attempt at a Solution
So after setting up my script as such
[y z] = ode45('fun',[0 10], vekt);
vekt being the vector for all values at x=0
I need to set up my function so ODE has something to work with.
I know what to do when I have d/dx in the equation since you can set dy/dx = z and then d2y/dx2 = y'. But now I have a value for dydx at x=0 but I don't have that in the equation.
So I'm at a loss.
Anyone can give me any pointers?