Why is ySol(t) = Dsolve(ode,cond) wrong? What should it be instead?
11 ビュー (過去 30 日間)
表示 古いコメント
I solved the ODE by subsituting the the data in 'C' (numerous values) and i got a series of around 10 ODE eqs that look like this (heres one as an example):
ode(t) = diff(y(t), t)= 83136/832 - (100*y(t))/5
I want to solve for y(t) for all 10 eqs so i tried
ySol(t) = dsolve(ode,cond)
with the cond being
cond = y(0) == C
where C is workspace of 10 know values which i used to solve for the ode
this is the wrong part which i cant right
ySol(t) = dsolve(ode,cond)
any ideas on how i can solve the 10 odes for y(t)??
Warning: Number of equations greater than number of indeterminates. Trying heuristics to reduce
to square system.
> In symengine
In mupadengine/evalin_internal
In mupadengine/feval_internal
In dsolve>mupadDsolve (line 334)
In dsolve (line 203)
Error using mupadengine/feval_internal
Unable to reduce to square system because the number of equations differs from the number of
indeterminates.
Error in dsolve>mupadDsolve (line 334)
T = feval_internal(symengine,'symobj::dsolve',sys,x,options);
Error in dsolve (line 203)
sol = mupadDsolve(args, options);
0 件のコメント
回答 (2 件)
Torsten
2022 年 1 月 1 日
syms Cs t y(t)
ode = diff(y,t) == 40*Cs-40/280*y;
cond = y(0) == Cs;
ySol(t) = dsolve(ode,cond);
ysol_num = subst(ySol,Cs,C)
Paul
2022 年 1 月 1 日
I think the ode needs to be solved first, and then sub in the values of y(0) to get the family of solutions (if I understand the question)
syms y(t) C
ode = diff(y,t) == 40*C-40/280*y;
ysol(t) = dsolve(ode)
Now solve for the constant C1 by enforcing the initial condition
syms C1
C1 = solve(ysol(0) == C,C1)
Now sub back into the solution
ysol(t) = subs(ysol(t))
Now sub in some values of C for specific initial conditions
y(t) = subs(ysol(t),C,[1 2])
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!