solve a partial differential equation
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
Hi! I want to solve a second partial differential equation.

The general solution is

Which command should I use to get the general solution? I think dsolve doesn't work well. Thanks for helping me.
댓글 수: 1
madhan ravi
2018년 10월 21일
Upload your code
채택된 답변
Stephan
2018년 10월 21일
Hi,
the following code solves the equation with the initial conditions:
y(0)=0
dy/dx(0)=0
Then it rewrites the result in terms of sin ans cos:
syms y(x) x E I N P c l Dyt(x)
eqn = E*I*diff(y,x,2)+N*y == -P*c/l*x;
[eqns, vars] = reduceDifferentialOrder(eqn,y);
conds = [y(0)==0,Dyt(0)==0];
sol = dsolve(eqns,conds);
sol_sin = simplify(rewrite(sol.y,'sin'))
I think that was the question.
Best regards
Stephan
댓글 수: 10
Yuchi Kang
2018년 10월 21일
Thanks for helping me. But it seems wrong.

In addition, reduceDifferentialOrder is used here. Could you please tell me a little bit about the reason?
Best regards
Yuchi Kang
Stephan
2018년 10월 21일
For me the code runs fine. Is there a copy paste mistake? Which Release do you use?
Yuchi Kang
2018년 10월 21일
Thanks for your reply. I have checked carefully, there is no paste mistake. R2017a is used.

madhan ravi
2018년 10월 21일
Works for me
Im using R2018b - let me check this. Maybe there is a difference in dsolve.
Can you show us the result of typing this in commmand line:
eqns
vars
after executing the code ans getting the error?
Here is the photo for executing the two commands.

I try to use R2018a. It does work and here is the result
sol_sin =
(N^(1/2)*P*c*x*sin((x*((-E*I*N)^(1/2)*1i + E^(1/2)*I^(1/2)*N^(1/2)))/(E*I))*1i - E^(1/2)*I^(1/2)*P*c*cos((N^(1/2)*x)/(E^(1/2)*I^(1/2)))*1i + E^(1/2)*I^(1/2)*P*c*cos((x*((-E*I*N)^(1/2)*1i + E^(1/2)*I^(1/2)*N^(1/2)))/(E*I))*1i)/(N^(3/2)*l)
Stephan
2018년 10월 21일
Nice. Problem solved?
Yuchi Kang
2018년 10월 21일
Yes. Almost done. Thanks. But I have a minor problem with the results. If I want to use this equation k^2=N/E/I to simplify my results. May I use the subs command?
Best regards Yuchi Kang
yes - this is what subs is for - i would suggest to this before reducing the differential order:
syms y(x) x E I N P c l Dyt(x) k
eqn = diff(y,x,2)+N/E*I*y == -P*c/(l*E*I)*x;
eqn = subs(eqn,(N/E*I),k^2)
[eqns, vars] = reduceDifferentialOrder(eqn,y);
conds = [y(0)==0,Dyt(0)==0];
sol = dsolve(eqns,conds)
sol_sin = rewrite(sol.y,'sin')
which gives:
sol_sin =
- ((P*c*1i)/(2*E*I*k^3*l) + (P*c*(- 1 + k*x*1i)*(sin(k*x)*1i - 2*sin((k*x)/2)^2 + 1)*1i)/(2*E*I*k^3*l))*(sin(k*x)*1i + 2*sin((k*x)/2)^2 - 1) - ((P*c*1i)/(2*E*I*k^3*l) + (P*c*(1 + k*x*1i)*(sin(k*x)*1i + 2*sin((k*x)/2)^2 - 1)*1i)/(2*E*I*k^3*l))*(sin(k*x)*1i - 2*sin((k*x)/2)^2 + 1)
You can also get rid of the imaginary parts of the results by making some assumptions. For example i suspect E to be youngs modul, which should be a real number and positive always:
syms y(x) x E I N P c l Dyt(x) k
eqn = diff(y,x,2)+N/E*I*y == -P*c/(l*E*I)*x;
eqn = subs(eqn,(N/E*I),k^2)
[eqns, vars] = reduceDifferentialOrder(eqn,y);
conds = [y(0)==0,Dyt(0)==0];
assume([x P c l k],'real');
assumeAlso(c>=0 & l>=0 & k>=0);
assumptions
sol = dsolve(eqns,conds)
sol_sin = rewrite(sol.y,'sin')
results in:
sol_sin =
(P*c*sin(k*x))/(E*I*k^3*l) - (P*c*x)/(E*I*k^2*l)
You should check if the assumptions i made are correct in your case and modify them if needed.
Stephan
2018년 10월 21일
If this answer was helpful to you, please accept it.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Assumptions에 대해 자세히 알아보기
태그
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
