The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: programming error
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  

Posts: 116
Registered: 5/24/12
programming error
Posted: Dec 5, 2012 4:36 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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
if isempty(K1)
K1=2; %initialized only once in the beginning

Pn= Vn*In
e= Pn-Pm
if e<0
Ip = Ipold+K2 *e
Ip = Ipold+K1 *e

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 ?

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.