Adding LTSPICE component to MATLAB
    18 次查看(过去 30 天)
  
       显示 更早的评论
    
We want to incorporate a SPICE component in our MATLAB model. 
We are using "subcircuit2ssc" command to add that component in MATLAB, but we are getting an error.
Please find the attached error snap-shot and component file in txt format.
0 个评论
回答(2 个)
  Maadhav Akula
    
 2020-5-28
        I think these errors come up usually indicating that there is a syntax or expression in the file that is not recognized or supported by Matlab's SPICE conversion assistant, which is described in detail here:
From looking at your component file I have found that upon removing the following lines 116,123 and 128(bolded below)
e5		NET5   0	Value {
+					if (V(gk,s)>11 ,
*+				(-0.9267*V(gk,s)**3+49.313*V(gk,s)**2-877.727*V(gk,s)+5351.268)/10000
+				((87.641n*V(Tj)**3+46.001u*V(Tj)**2-15.03m*V(Tj)-0.13539)*V(gk,s)**3+
+				(-4.7725u*V(Tj)**3-2.0118m*V(Tj)**2+0.69225*V(Tj)+13.826)*V(gk,s)**2+
+				(86.016u*V(Tj)**3+27.876m*V(Tj)**2-10.322*V(Tj)-366.33)*v(gk,s)+
+				(-496.9u*V(Tj)**3-0.12272*V(Tj)**2+49.167*V(Tj)+3084.3))/10000
+					,
+					if (V(gk,s)<=11 & V(gk,s)>9,
*+				(15*V(gk,s)**2-245*V(gk,s)+1470)/10000
+				((8.3091u*V(Tj)**3+1.2517m*V(Tj)**2-0.30635*V(Tj)-4.25318)*(V(gk,s)**2)+
+				(-166.98u*V(Tj)**3-21.874m*V(Tj)**2+4.7236*V(Tj)+53.187)*v(gk,s)+
+				(821.34u*V(Tj)**3+90.986m*V(Tj)**2-15.564*V(Tj)+475.4))/10000
+					,
*+				(13.958*V(gk,s)**2-158.333*V(gk,s)+774.375)/10000
and also by removing the semicolon in the line 217(bolded below), you should be able to build your library!
+		(Cjo/(1+(limit(v(dk,s),0,460)/Vj)**M))*ddt(v(dk,s))  ;
This behavior might be due to the comments (as * and ; are treated as comments) in the middle of a multi-line expression.
Hope this helps!
0 个评论
  Shrinivas Hanchate
 2020-6-1
        2 个评论
  Maadhav Akula
    
 2020-6-1
				I think ddt inside a function call is not supported by the conversion assistant, please have a look at the limitations page:
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Choose and Parameterize Blocks 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

