필터 지우기
필터 지우기

Slow simulation when using asind

조회 수: 4 (최근 30일)
Eleni.T
Eleni.T 2020년 6월 11일
댓글: Eleni.T 2020년 6월 11일
hello!
I am trying t model a sun position algorithm in simulink and i used the embedded matlab function. My simulation time is 10*3600s. The function includes:
function [altitude, azimuth]= fcn(N, SL, LL, L, LST)
B=(N-81)*360/364;
ET=9.87*sind(2*B)-7.53*cosd(B)-1.5*sind(B);
AST=LST*60+ET+4*(SL-LL);
h=(AST/60-12)*15;
delta=(23.45*sind(360/365*(284+N)));
altitude=asind(sind(L)*sind(delta)+cosd(L)*cosd(delta)*cosd(h));
azimuth=asind(cosd(delta)*sind(h)/cosd(altitude));
However, when i use the 'asind' instead of 'asin' for the 'azimuth=asind(cosd(delta)*sind(h)/cosd(altitude))' equation, the simulation becomes extremely slow and i never get an answer. When i use asin I get an answer very quickly, though it is not correct since it is in radians instead of degrees. Does anyone know any potential reason for this extremely slow running?
Thank you
  댓글 수: 2
darova
darova 2020년 6월 11일
you can convert radians to degree manually
a2 = a1*180/pi; % convert angle a1 (radius) to degrees
Eleni.T
Eleni.T 2020년 6월 11일
I tried that too but running is still very slow

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by