New Reply

differential equation problem with Matlab

 
Share Thread Thread Tools
Nov1-11, 05:04 PM   #1
 

differential equation problem with Matlab


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

2. Relevant 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.


3. 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?
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> Galaxies fed by funnels of fuel
>> The better to see you with: Scientists build record-setting metamaterial flat lens
>> Google eyes emerging markets networks
Nov1-11, 06:57 PM   #2
 
You don't even need to use ODE45 for this. There's a simpler way; cf. http://www.math.tamu.edu/REU/comp/matode.pdf, which uses the function dsolve
Nov2-11, 12:34 AM   #3
 
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
Nov2-11, 03:45 AM   #4
 

differential equation problem with Matlab


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?
Nov2-11, 04:04 AM   #5
 
Recognitions:
Homework Helper Homework Help
Quote by damightytom View Post
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?
Nov2-11, 04:11 AM   #6
 
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.
New Reply
Thread Tools


Similar Threads for: differential equation problem with Matlab
Thread Forum Replies
2nd order nonhomogenus differential equation in matlab Engineering, Comp Sci, & Technology Homework 1
matlab problem for implicit differential equation Calculus 0
Solving a Differential Equation with Matlab - No solutions Math & Science Software 0
differential equation MATLAB Math & Science Software 0
differential equation MATLAB Math & Science Software 0