programming error jamming in simulink
古いコメントを表示
I have two constants K1 and K2 I need them to be different because i have breaking point
function [e,Pm,Ip] = new(In,Vn)
persistent Ipold K1 ; if isempty(Ipold) Ipold=2; %initialized only once in the beginning end if isempty(K1) K1=2; %initialized only once in the beginning end
K1=5; K2=.19; Pn= Vn*In Pm=100*In e= Pn-Pm if e<0 Ip = Ipold+K2 *e else Ip = Ipold+K1 *e end
gave error message Trouble solving algebraic loop containing 'che/Guess' at time 0. Stopping simulation. There may be a singularity in the solution. If the model is correct, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)
I can't understand what is the objection ?
4 件のコメント
TAB
2012 年 12 月 6 日
Your code is working for me without any error.
I pasted your code in matlab function block in simulink (which is the only place where we can run a m-code you like posted here) and it was working.
回答 (1 件)
カテゴリ
ヘルプ センター および File Exchange で Multicore Processor Targets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!