Differential equation problem with Matlab

Click For Summary

Homework Help Overview

The discussion revolves around solving a system of differential equations involving two variables, y and z, with specific initial conditions. The equations include second derivatives and require the use of numerical methods for solutions, particularly in the context of MATLAB's ODE45 function.

Discussion Character

  • Exploratory, Mathematical reasoning, Problem interpretation, Assumption checking

Approaches and Questions Raised

  • Participants discuss the need to define first derivatives dy/dx and dz/dx based on given initial conditions, questioning how to incorporate these into the equations. There is mention of alternative methods such as using dsolve instead of ODE45. Some participants explore the transformation of second-order equations into first-order ones.

Discussion Status

The discussion is ongoing, with participants sharing different perspectives on how to approach the problem. Some have suggested simpler methods, while others express confusion about handling the initial conditions and the absence of first derivatives in the equations. There is a recognition of the complexity involved in transforming the equations appropriately.

Contextual Notes

Participants are grappling with the challenge of setting up their functions for numerical solvers, particularly in relation to the initial conditions provided. There is an emphasis on the need to convert second-order equations into first-order forms for numerical solutions.

damightytom
Messages
17
Reaction score
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

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?
 
Physics news on Phys.org
Thanks for the heads up, but the main problems for me is to understand what I should do with dydx and dzdx that can't be found in the equation but have a value at x=0
 
Do I have to find the antiderivitive for d2y/dx2 in order to get dy/dx and then solve it?

Or is there some kind of trick into getting dy/dx in the equation?
 
damightytom said:
Do I have to find the antiderivitive for d2y/dx2 in order to get dy/dx and then solve it?

Or is there some kind of trick into getting dy/dx in the equation?

Remember that numerical solvers for ODEs work on solving first order ODEs only. How would you transform the second equation to give you first order ODEs only?
 
d2z/dx2 = -(z – y)

z''=-(z-y)

q=[y';y'']

y(1)=z''
y(2)=z'

Can I do something like that so I have ekv=y(2); -(z-y) for the second equation?

I'm out in very deep water, I would kinda know what to do if I saw dy/dx in the equations, but now I don't so I'm pretty much guessing.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
839
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
3
Views
2K
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 24 ·
Replies
24
Views
2K