Iszlai Lehel
Iszlai Lehel

Reputation: 231

Solving this differential equation with matlab?

This would be it : y'(t)=y(t)/t-t^2/y^2*t y(1)=1

i have tried: function hazi3b()

[T,Y] = ode45( @bfugveny, [1 12], 1); plot(T, Y, 'gx')

end

and:

function dy=bfugveny(t,y)

dy = y(t)/t - t^2/(y^2*t);

end

Upvotes: 1

Views: 209

Answers (1)

Ben Voigt
Ben Voigt

Reputation: 283624

You don't need to write y(t) in your formula.

The y passed into your oracle is already a guess for y-evaluated-at-time-t.

So try

dy = y/t - t^2/(y^2*t);

Upvotes: 2

Related Questions