<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1442898080852_4286"><span>Hi Tim,</span></div><div id="yui_3_16_0_1_1442898080852_4286"><span><br></span></div><div id="yui_3_16_0_1_1442898080852_4286" dir="ltr"><span id="yui_3_16_0_1_1442898080852_4334">Thank you for the quick feedback.  The inductance changes with position and I have taken measurements of the inductance vs. position.  I have the position data from model of the mechanical system, a simply sprung-damped mass system.  </span></div><div id="yui_3_16_0_1_1442898080852_4286" dir="ltr"><span><br></span></div><div id="yui_3_16_0_1_1442898080852_4286" dir="ltr"><span id="yui_3_16_0_1_1442898080852_4805">What I don't know how to do is to either break up the math into constituent blocks (I can't find a block for Euler number or to program a block that can take the inductance in as an input parameter (although I do program in various languages, I've never programmed in scilab or xcos before).  </span></div><div id="yui_3_16_0_1_1442898080852_4286" dir="ltr"><span><br></span></div><div id="yui_3_16_0_1_1442898080852_4286" dir="ltr"><span id="yui_3_16_0_1_1442898080852_4847">What would be the best way to proceed, in your opinion? Separate blocks or program a custom block?</span></div><div id="yui_3_16_0_1_1442898080852_4286" dir="ltr"><span><br></span></div><div id="yui_3_16_0_1_1442898080852_4286" dir="ltr"><span>Thanks,</span></div><div id="yui_3_16_0_1_1442898080852_4286" dir="ltr"><span><br></span></div><div id="yui_3_16_0_1_1442898080852_4286" dir="ltr"><span>Mike</span></div><div id="yui_3_16_0_1_1442898080852_4804"><br></div><div id="yui_3_16_0_1_1442898080852_4798"><br></div>  <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_1_1442898080852_4337"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_1_1442898080852_4336"> <div dir="ltr" id="yui_3_16_0_1_1442898080852_4335"> <hr size="1" id="yui_3_16_0_1_1442898080852_4464">  <font size="2" face="Arial" id="yui_3_16_0_1_1442898080852_4890"> <b><span style="font-weight:bold;">From:</span></b> Tim Wescott <tim@wescottdesign.com><br> <b><span style="font-weight: bold;">To:</span></b> Michael Greenish <greanie@yahoo.com>; Users mailing list for Scilab <users@lists.scilab.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Monday, September 21, 2015 8:55 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Scilab-users] Modeling current in a solenoid<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_1_1442898080852_4756"><br>On Mon, 2015-09-21 at 08:00 +0000, Michael Greenish wrote:<br clear="none">> Hi,<br clear="none">> <br clear="none">> <br clear="none">> I need to model the current in a solenoid.  I would use a resistor<br clear="none">> with the standard inductor model but the inductance changes<br clear="none">> considerably with position of the solenoid plunger (as the solenoid is<br clear="none">> closing).  The standard inductor model only accommodates a fixed<br clear="none">> inductance.<br clear="none">> <br clear="none">> <br clear="none">> The equation for inductor current is:<br clear="none">> <br clear="none">> <br clear="none">>       I(t) = (V/R)[1-eˆ(-Rt/L)]<br clear="none">> <br clear="none">> <br clear="none">> Anyone have any suggestions?<br clear="none">> <br clear="none">Hey Mike:<br clear="none"><br clear="none">That's the equation for inductor current when driven by a voltage, yes.<br clear="none">It comes from the differential equation:<br clear="none"><br clear="none">i(t) * R + (d/dt i(t)) L = V.  It's a first-order ordinary linear<br clear="none">differential equation.<br clear="none"><br clear="none">Life gets complicated when you have that solenoid in there.  I'm almost<br clear="none">certain that the correct way to model the i/v behavior of the solenoid<div class="qtdSeparateBR"><br><br></div><div class="yqt5019786403" id="yqtfd83004"><br clear="none">is</div><br clear="none"><br clear="none">v_l(t) = d/dt (i(t) * L(t))<br clear="none"><br clear="none">-- in other words, accept that both current and inductance change with<br clear="none">time, and take the derivative of the pair.  The place to look to check<br clear="none">up on my assumption is texts in electrical machines (it's a 3rd-year<br clear="none">electronics course.  My book is "Electric Machines: Steady-State Theory<br clear="none">and Dynamic Performance" by Mulukutla S. Sarma, WCB, 1985.<br clear="none"><br clear="none">Note that, at best, you'll have to treat the system as a time-varying<br clear="none">linear system, and you may have to treat the system as being nonlinear<br clear="none">(depending on how quickly the solenoid position varies with time<br clear="none">compared to the current).  You'll also see that finding the inductance<br clear="none">vs. position relationship is (ehem) left as an exercise to the reader.<br clear="none"><br clear="none">This isn't a complete answer, but I hope that it sets your feet on the<br clear="none">right road.<br clear="none"><br clear="none">-- <br clear="none"><br clear="none">Tim Wescott<br clear="none">www.wescottdesign.com<br clear="none">Control & Communications systems, circuit & software design.<br clear="none">Phone: 503.631.7815<br clear="none">Cell:  503.349.8432<div class="yqt5019786403" id="yqtfd10096"><br clear="none"><br clear="none"><br clear="none"></div><br><br></div> </div> </div>  </div></body></html>