필터 지우기
필터 지우기

Solving an equation in Matlab

조회 수: 4 (최근 30일)
Pablo Estuardo
Pablo Estuardo 2020년 2월 12일
댓글: Star Strider 2020년 2월 13일
Dear, I'm trying to resolve this equation for my thesis project, u and v are the values that I try to calculate, the only parameter that change is the Tx and Ty, all the other parameters are constant. I appreciate any help
Screen Shot 2020-02-12 at 1.08.04 PM.png
tx = [0.1 0.5 0.12 0.14 0.22 0.1 0.12 0.29]
ty = [0.4 0.12 0.34 0.14 0.13 0.03 0.2 0.13]
Omega = 7.3E-5;
latitude = -12;
f0 = 2*Omega*sind(latitude);
r = 1./(2.*24.*3600)
Hm = 25
rho = 1.025e3
dvdt0 = -r.*v0 - f0.*u0 -ty./(rho.*Hm);
dudt0 = -r.*u0 + f0.*v0 + tx./(rho.*Hm);

채택된 답변

Star Strider
Star Strider 2020년 2월 12일
These have analytic solutions:
syms u(t) v(t) f taux tauy Hm rho R u0 v0
du = diff(u);
dv = diff(v);
DE = [du - f*v == taux/(Hm*rho) - R*u; dv - f*u == taux/(Hm*rho) - R*v]
Soln = dsolve(DE, u(0)==u0, v(0)==v0)
u_Soln = Soln.u;
v_Soln = Soln.v;
u_Soln = simplify(u_Soln, 'Steps',500)
v_Soln = simplify(v_Soln, 'Steps',500)
u_fcn = matlabFunction(u_Soln)
v_fcn = matlabFunction(v_Soln)
Note that ‘u_fcn’ and ‘v_fcn’ are anonymous functions you can use outside of the Symbolic Math Toolbox.
  댓글 수: 10
Pablo Estuardo
Pablo Estuardo 2020년 2월 13일
편집: Pablo Estuardo 2020년 2월 13일
Thanks Star, you helping me a lot, now im going to try to make the dsolve works, in that way I can add more terms to try new solutions, again, thanks you so much for your time... best regards.
syms u(t) v(t) f taux tauy Hm rho R u0 v0
du = diff(u);
dv = diff(v);
DE = [du - f*v == taux/(Hm*rho) - R*u; dv + f*u == tauy/(Hm*rho) - R*v]
Soln = dsolve(DE, u(0)==u0, v(0)==v0)
u_Soln = Soln.u;
v_Soln = Soln.v;
u_Soln = simplify(u_Soln, 'Steps',500)
v_Soln = simplify(v_Soln, 'Steps',500)
u_fcn = matlabFunction(u_Soln)
v_fcn = matlabFunction(v_Soln)
Star Strider
Star Strider 2020년 2월 13일
As always, my pleasure!
I will help as I can.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numbers and Precision에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by