Explicit solution could not be found.. > In dsolve at 194
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
siddharth tripathi
am 1 Jun. 2017
Kommentiert: Star Strider
am 9 Jul. 2017
here is my code :
>>sums u(t) v(t)
>>ode1= diff(u)==u^2/v - u
>>ode2= diff(v) == u^2-v
>>odes=[ode1;ode2]
0 Kommentare
Akzeptierte Antwort
Star Strider
am 1 Jun. 2017
An analytic (symbolic) solution does not exist. You must us a numeric solver.
The Code —
syms T t u(t) v(t) u0 v0 Y
Du = diff(u);
Dv = diff(v);
ode1 = Du == u^2/v - u;
ode2 = Dv == u^2-v;
[ode_vf, ode_subs] = odeToVectorField(ode1,ode2);
ode_fcn = matlabFunction(ode_vf, 'vars',{T,Y});
tspan = linspace(0, 10, 150);
icv = [0; 0]+sqrt(eps);
[t,y] = ode45(ode_fcn, tspan, icv);
figure(1)
plot(t, y)
grid
23 Kommentare
Star Strider
am 9 Jul. 2017
My pleasure.
Here you go:
syms T t u(t) v(t) u0 v0 Y
Du = diff(u);
Dv = diff(v);
ode1 = Du == u^2/v - u;
ode2 = Dv == u^2-v;
[ode_vf, ode_subs] = odeToVectorField(ode1,ode2);
ode_fcn = matlabFunction(ode_vf, 'vars',{T,Y});
tspan = linspace(0, 10, 250);
icv = [0; 0]+sqrt(eps);
[t,y] = ode45(ode_fcn, tspan, icv);
figure(1)
plot(t, y)
grid
lgndc = sym2cell(ode_subs); % Get Substituted Variables
lgnds = regexp(sprintf('%s\n', lgndc{:}), '\n','split'); % Create Cell Array
legend(lgnds(1:end-1), 'Location','NW', 'Location','NE') % Display Legend
figure(2)
subplot(2,1,1)
plot(t, y(:,1))
title([lgnds{1} '(t)'])
xlabel('\bft\rm')
ylabel('\bfAmplitude\rm')
subplot(2,1,2)
plot(t, y(:,2))
title([lgnds{2} '(t)'])
xlabel('\bft\rm')
ylabel('\bfAmplitude\rm')
Weitere Antworten (1)
Walter Roberson
am 2 Jun. 2017
Making the assumption that you made a minor typing mistake in entering your question, and that you are asking about
syms u(t) v(t)
ode1= diff(u)==u^2/v - u;
ode2= diff(v) == u^2-v;
odes = [ode1;ode2];
dsolve(odes)
then MATLAB is not able to provide analytic solutions. However, two analytic solutions exist:
1)
u(t) = 0
v(t) = C1 * exp(-t)
where C1 is an arbitrary constant whose value depends upon the initial conditions
2)
u(t) = RootOf(-Intat(-LambertW(-C1*exp(a_)/a_)/(a_*(LambertW(-C1*exp(a_)/a_)+1)), a_ = Z_) + t + C2)
v(t) = u(t)^2/(diff(u(t), t)+u(t))}
that ugly formula for u(t) says that there is a particular function involving a ratio of LambertW formulas, and that for any given t, u(t) is the value such that the integral of the ratio, evaluate at that value, is 0.
This is ugly. But it does provide a path to an analytic solution, of sorts. But it is beyond the capacity of MATLAB.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Calculus finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!