<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic You could take a look at the in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175377#M147267</link>
    <description>&lt;P&gt;You could take a look at the code available at the NIST GAMS (Guide to Available Mathematical Software) site:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://gams.nist.gov/" target="_blank"&gt;http://gams.nist.gov/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Use the key word search for terms such as "linear regression" or "curve fit" to see the available subroutines. &amp;nbsp;Maybe a routine will fit your need, or at least provide examples.&lt;/P&gt;

&lt;P&gt;Regards, Greg&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Aug 2017 14:22:13 GMT</pubDate>
    <dc:creator>Greg_T_</dc:creator>
    <dc:date>2017-08-31T14:22:13Z</dc:date>
    <item>
      <title>Read from a .txt file a character equation "y=m*x+c" and convert it into mathematical expression in Fortran code</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175370#M147260</link>
      <description>&lt;P&gt;Has anyone any idea about it?&lt;/P&gt;

&lt;P&gt;if i read it as character, there seem no way to convert into mathematical expression in fortran code. It stays as character.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 14:25:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175370#M147260</guid>
      <dc:creator>Eng_Giap_G_</dc:creator>
      <dc:date>2017-08-30T14:25:51Z</dc:date>
    </item>
    <item>
      <title>What do you mean by "convert</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175371#M147261</link>
      <description>&lt;P&gt;What do you mean by "convert into mathematical expression"? There is no intrinsic variable type in Fortran called "mathematical expression" or endowed with the usual expected properties of mathematical expressions.&lt;/P&gt;

&lt;P&gt;Are you trying to program a calculator in Fortran? Be aware that this has been done several times, but it is by no means simple to do.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 19:37:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175371#M147261</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2017-08-30T19:37:50Z</dc:date>
    </item>
    <item>
      <title>Is this part of a computer</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175372#M147262</link>
      <description>&lt;P&gt;Is this part of a computer science test problem? e.g. write a Fortran program to parse equations.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 20:13:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175372#M147262</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2017-08-30T20:13:25Z</dc:date>
    </item>
    <item>
      <title>Hi guy, I'm trying to write a</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175373#M147263</link>
      <description>&lt;P&gt;Hi guy, I'm&amp;nbsp;trying to write a program to conduct regression (or curve-fitting), I could not convert the read character into statement useable in Fortran&amp;nbsp;. My problem as below:&lt;/P&gt;

&lt;P&gt;subroutine set_eqn_and_initial_val1&lt;/P&gt;

&lt;P&gt;use mod_share_GNA1&lt;BR /&gt;
	implicit none&lt;/P&gt;

&lt;P&gt;character(999)::scha1&lt;BR /&gt;
	real(kind=srk)::y,m,x,c&lt;/P&gt;

&lt;P&gt;open(unit=1000,file='data_input\\eqn_and_initial_value.txt',status='old',action='read')&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; read(1000,*)scha1&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; write(*,*)scha1&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; y=real(trim(scha1)) &amp;nbsp; &amp;nbsp; &amp;lt;===== this statement is wrong. Could someone help me to move forward?&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	close(unit=1000)&lt;/P&gt;

&lt;P&gt;end subroutine set_eqn_and_initial_val1&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 01:44:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175373#M147263</guid>
      <dc:creator>Eng_Giap_G_</dc:creator>
      <dc:date>2017-08-31T01:44:08Z</dc:date>
    </item>
    <item>
      <title>You might like to look up</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175374#M147264</link>
      <description>&lt;P&gt;You might like to look up this:&lt;/P&gt;

&lt;P&gt;&amp;nbsp; !------- -------- --------- --------- --------- --------- --------- --------- -------&lt;BR /&gt;
	&amp;nbsp; ! Fortran 90 function parser v1.1&lt;BR /&gt;
	&amp;nbsp; !------- -------- --------- --------- --------- --------- --------- --------- -------&lt;BR /&gt;
	&amp;nbsp; !&lt;BR /&gt;
	&amp;nbsp; ! This function parser module is intended for applications where a set of mathematical&lt;BR /&gt;
	&amp;nbsp; ! fortran-style expressions is specified at runtime and is then evaluated for a large&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; ! number of variable values. This is done by compiling the set of function strings&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; ! into byte code, which is interpreted efficiently for the various variable values.&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; !&lt;BR /&gt;
	&amp;nbsp; ! The source code is available from &lt;A href="http://fparser.sourceforge.net" target="_blank"&gt;http://fparser.sourceforge.net&lt;/A&gt;&lt;BR /&gt;
	&amp;nbsp; !&lt;BR /&gt;
	&amp;nbsp; ! Please send comments, corrections or questions to the author:&lt;BR /&gt;
	&amp;nbsp; ! Roland Schmehl &amp;lt;roland.schmehl@alumni.uni-karlsruhe.de&amp;gt;&lt;BR /&gt;
	&amp;nbsp; !&lt;BR /&gt;
	&amp;nbsp; !------- -------- --------- --------- --------- --------- --------- --------- -------&lt;BR /&gt;
	&amp;nbsp; ! The function parser concept is based on a C++ class library written by &amp;nbsp;Juha&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; ! Nieminen &amp;lt;warp@iki.fi&amp;gt; available from &lt;A href="http://warp.povusers.org/FunctionParser/" target="_blank"&gt;http://warp.povusers.org/FunctionParser/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 01:49:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175374#M147264</guid>
      <dc:creator>DavidWhite</dc:creator>
      <dc:date>2017-08-31T01:49:00Z</dc:date>
    </item>
    <item>
      <title>Quote:Eng Giap G. wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175375#M147265</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Eng Giap G. wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;character(999)::scha1&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;open(unit=1000,file='data_input\\eqn_and_initial_value.txt',status='old',action='read')&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; read(1000,*)scha1&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 11.382px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; y=real(trim(scha1)) &amp;nbsp; &amp;nbsp; &amp;lt;===== this statement is wrong. Could someone help me to move forward?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;The function REAL cannot be applied to character type arguments.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;To answer your question regarding moving forward, we need to know the contents of the file.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;If you are satisfied with fitting only linear expressions or polynomials, it would be enough to structure the input data accordingly.&lt;/P&gt;

&lt;P&gt;Linear regression does not require trial values of the fit coefficients.&lt;/P&gt;

&lt;P&gt;Writing an&amp;nbsp;&lt;SPAN style="font-size: 11.382px;"&gt;expression parser&lt;/SPAN&gt;(or even adopting an existing one) &amp;nbsp;is probably an overkill for your needs. Please explain what you want your program to do, and remember that Fortran is a compiled language.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 02:32:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175375#M147265</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2017-08-31T02:32:00Z</dc:date>
    </item>
    <item>
      <title>It looks to me as if he</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175376#M147266</link>
      <description>&lt;P&gt;It looks to me as if he simply wants to do linear regression on a set of points.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 02:37:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175376#M147266</guid>
      <dc:creator>gib</dc:creator>
      <dc:date>2017-08-31T02:37:01Z</dc:date>
    </item>
    <item>
      <title>You could take a look at the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175377#M147267</link>
      <description>&lt;P&gt;You could take a look at the code available at the NIST GAMS (Guide to Available Mathematical Software) site:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://gams.nist.gov/" target="_blank"&gt;http://gams.nist.gov/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Use the key word search for terms such as "linear regression" or "curve fit" to see the available subroutines. &amp;nbsp;Maybe a routine will fit your need, or at least provide examples.&lt;/P&gt;

&lt;P&gt;Regards, Greg&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 14:22:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175377#M147267</guid>
      <dc:creator>Greg_T_</dc:creator>
      <dc:date>2017-08-31T14:22:13Z</dc:date>
    </item>
    <item>
      <title>The following Fortran program</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175378#M147268</link>
      <description>&lt;P&gt;The following Fortran program uses MKL/Lapack-95 GELS to obtain the least squares polynomial to fit input x,y data. The first line of the data file contains the degree and the number of input data pairs. The subsequent lines contain (x(i),y(i), i = 1, m) data.&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;program polyfit
use lapack95, only : gels
implicit none
double precision, allocatable :: x(:),y(:,:),c(:),A(:,:)
integer :: i,j,m,n,info
read(*,*)n,m                  ! degree and number of data pairs
allocate(x(m),y(m,1),c(n+1))
read(*,*)(x(i),y(i,1),i=1,m)  ! data pairs
allocate(A(m,n+1))
A(:,1) = 1d0
do j=2,n+1
   A(:,j) = A(:,j-1)*x
end do
call gels(A,y,'N',info)
if(info /= 0)then
   write(*,*)'*** INFO = ',info,' FROM GELS' 
   stop
endif
c=y(1:n+1,1)                  ! coefficients of polynomial
write(*,10)(i,c(i),i=1,n+1)
10 format(I3,2x,ES12.4)
end program polyfit&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;Sample data file:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;1,3
1,4.01
2,5.49
3,6.95&lt;/PRE&gt;

&lt;P&gt;Program results (coefficients):&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;  1    2.5433E+00
  2    1.4700E+00&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 16:44:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175378#M147268</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2017-08-31T16:44:19Z</dc:date>
    </item>
    <item>
      <title>This might be an assignment -</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175379#M147269</link>
      <description>&lt;P&gt;This might be an assignment - I'm not sure that we should do students' assignments for them.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 22:47:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175379#M147269</guid>
      <dc:creator>gib</dc:creator>
      <dc:date>2017-08-31T22:47:44Z</dc:date>
    </item>
    <item>
      <title>I agree, but one would hope</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175380#M147270</link>
      <description>&lt;P&gt;I agree, but one would hope that if this is a homework problem the instructor would have stipulated that the student must include a verbal description of the underlying linear algebra and an explanation of how the code implements the underlying algorithm.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2017 23:49:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175380#M147270</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2017-08-31T23:49:09Z</dc:date>
    </item>
    <item>
      <title>Hi, guys, thanks for helping</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175381#M147271</link>
      <description>&lt;P&gt;Hi, guys, thanks for helping out. I will look into all the recommendation and suggestion. This is not a student assignment. I am a researcher and I'm trying to code to solve a scientific problem. The solution of the problem would most likely end up in the hand of researchers like field biologist (environmentalist) who has limited access to expensive software, and also the ability to customize equation to fit their&amp;nbsp;needs and data management to save time. Thanks again for all those who are helping out. This would also help others encountering a similar problem.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2017 14:40:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Read-from-a-txt-file-a-character-equation-quot-y-m-x-c-quot-and/m-p/1175381#M147271</guid>
      <dc:creator>Eng_Giap_G_</dc:creator>
      <dc:date>2017-09-04T14:40:02Z</dc:date>
    </item>
  </channel>
</rss>

