Problem passing from single symbolic differential equation to multiple: Error using Mupadengine/feval - Error in dsolve>mupadDsolve - Error in dsolve
2 次查看(过去 30 天)
显示 更早的评论
Hello, I can't understand the solution of multiple equations. Now I've got indipendent equations, then the program should solve them separately (it works) and together(it doesn't!), shouldn't it? I'm writing the code, can anyone help?
This is the part of code in common with both procedures
if true
%
creating symbolic functions
syms v(z) w(z)
syms B Chiterm p mx by l A Eterm p bz
differentiating
D1v = diff(v,z);
D2v = diff(v,z,2);
D3v = diff(v,z,3);
D4v = diff(v,z,4);
D1w = diff(w,z);
D2w = diff(w,z,2);
setting datas
by=-p;
Chiterm=0;
mx=0
bz=0;
Eterm=0;
defining differential equations
odetrasv = diff(B*(diff(v,z,2)+Chiterm),z,2)-mx-by == 0;
odelong = diff(A*(diff(w,z)-Eterm),z)+bz == 0;
defining initial conditions
cond1 = B*D2v(l) == 0;
cond2 = D1v(0) == 0;
cond3 = v(0) == 0;
cond4 = v(l) == 0;
cond5 = D1w(l) == 0;
cond6 = w(0) == 0;
end
here is the part of the code that solves equations separately:
if true
%
condstrasv = [cond1 cond2 cond3 cond4];
condslong = [cond5 cond6];
vSol(z) = dsolve(odetrasv, condstrasv);
wSol(z) = dsolve(odelong, condslong);
vSol = simplify(vSol)
wSol = simplify(wSol)
end
and here's the part not working: i'm trying to solve them togheter, since the next step is solving a system of multiple equations
if true
%
odes = [odetrasv; odelong];
conds = [cond1; cond2; cond3; cond4; cond5; cond6];
[vSol(z), wSol(z)] = dsolve(odes,conds)
end
Matlab says:
- Error using Mupadengine/feval - Invalid initial conditions
- Error in dsolve>mupadDsolve - T=feval(symengine,'symobj::dsolve',sys....
- Error in dsolve - sol = mupadDsolve(args, options);
Why initial conditions would be invalid in this second procedure? Solving without them would work:
if true
%
[vSol(z), wSol(z)] = dsolve(odes)
end
many thanks
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Equation Solving 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!