Help me draw a ODE solution in Matlab

Status
Not open for further replies.

david753

Full Member level 1
Joined
Jan 9, 2005
Messages
96
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
856
If a ODE's answer is sqrt(y^2-1)/y=C*Exp(x), C in constant number.
How can I draw it in mathlab?
 

Re: answer of O.D.E

The trick I think is to solve this for x. Try this code...

clf; hold on;
Y = linspace(-4,4,10000);
C = [1:5];
COL = { 'r' 'g' 'b' 'c' 'k' };
L = {};
NC = length(C);
for nc = 1 : NC
X = log(sqrt(Y.^2 - 1)/C(nc)./Y);
plot(X,Y,COL{nc});
L{nc} = ['C = ' num2str(C(nc))];
end
hold off;
legend(L);
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…