Aug 23, 2007 #1 D 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?
Aug 30, 2007 #2 rrumpf Full Member level 5 Joined Jul 6, 2007 Messages 294 Helped 66 Reputation 132 Reaction score 43 Trophy points 1,308 Location El Paso, TX Activity points 3,624 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);
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);