matlabkhooneh

تکالیف پایتون Python - حلقه ها ( کد Py0009 )

Q1. Function and branching [35 pts]. Write a Python function ( named psi ) to evaluate the below mathematical function numerically for given values of x ,n and L.

\[\psi (x,n,L)=\left \{ \begin{matrix} \sqrt{\frac{2}{L}}sin\frac{n\pi x}{L} & 0\leq x\leq L\\ 0& otherwise \end{matrix} \right.\]
Test your function for x=-1 , x=0 and x=L/2.

 

Q2. Loops and data Files [30pts] . Choosing n=1 and L=1, write the value of psi to a data file ( named psi.dat ) for -1<x<2 using 301 points on the x-axis.

Hint : in case you need it , the mathematical definition of psi is below.

\[\psi (x,n,L)=\left \{ \begin{matrix} \sqrt{\frac{2}{L}}sin\frac{n\pi x}{L} & 0\leq x\leq L\\ 0& otherwise \end{matrix} \right.\]

| جهت سفارش پروژه ، تکلیف و آموزش سیمولینک Simulink  و  متلب Matlab لطفا در شبکه های تلگرام و واتساپ موضوع و سوال مورد نظر را به شماره  989364847193+ ارسال نمایید، تا پس از بررسی هزینه خدمت شما اعلام گردد.

موضوعات
Designed By M A T L A B K H O O N E H