Enable contrast version

Tutor profile: Atul A.

Online
Atul A.
Scientist in Technical University of Munich (TUM)
Tutor Satisfaction Guarantee

Questions

Subject:Applied Mathematics

TutorMe
Question:

There are multiple methods to solve Differential and Partial differential equations (PDE) numerically. Finite element, Finite volume, Spectral finite element, Gelarkin methods etc. But when the PDE is highly non linear can we use modern optimization methods such as Deep neural network to solve a PDE if we know solution ar sparse points. If so how?

Inactive
Atul A.

Suppose we have a differential equation: $$\mathcal{N}_x[u(x);\eta]=0 \quad x\in\mathcal{D}$$ $$B.C. : \mathcal{B}_x[u]=0, \quad x\in \Gamma$$ where $$\mathcal{N}_x$$ is a general form of a differential operator that could be non-linear, $$\mathcal{D}$$ is a d-dimensional physical domain in $$\mathbb{R}^d$$, $$u(x)$$ is the solution to this equation and $$\eta$$ denotes the parameters (e.g, Reynolds number, Prandl number in case of Navier Stokes equation). The boundary condition is imposed through the generalized boundary condition operator $$\mathcal{B}_x$$ at the domain boundary $$\Gamma$$. A deep neural network $$DNN$$ is constructed for this differential equation predicting the solution as $$\hat{u}(x;\theta)$$ which acts as a surrogate to the solution $$u$$. It takes the coordinate $$x$$ as the input to the network being fed in the input layer and outputs a vector that has the same dimension as $$u$$. As before, $$\theta$$ is used to denote the DNN parameters that will be tuned at the training stage containing the weights $$w$$ and biases $$b$$ in $$\hat{u}(x;\theta)$$. Now numerical differentiation needs to performed for the surrogate solution $$\hat{u}$$ with respect to the input. This is achieved by applying chain rule for differentiating compositions of functions using the automatic differentiation. The constraints on $$\hat{u}$$ is summation of two aspects: first, given the set of scattered data of the $$u(x)$$ observations (also called labels), the network should be able to reproduce the observed value, when taking the associated $$x$$ as input; second, $$\hat{u}$$ should comply with the physics imposed by above equation. The second part is achieved by defining a residual network: $$\mathcal{C}:= \mathcal{N}_x[u(x;\theta);\eta]=0,$$ which is computed from $$\hat{u}$$ and $$\theta$$ using automatic differentiation. This residual network $$\mathcal{C}$$ is named the physics-informed neural network (PINN) and it should output constant 0 for any input $$x \in \mathcal{D}$$. This network share the parameters $$\theta$$ with the $$DNN$$ given by $$\hat{u}(x;\theta)$$ so as to fine tune $$\theta$$ to minimize the loss function that reflects both the above DNN. The loss is given by $$E(\theta)= ||\hat{u}(x;\theta)-u(x)||^2 + ||\mathcal{C}(\hat{u}(x;\theta))||^2$$ The optimised/trained parameters $$\theta$$ is given by $$\theta = \textrm{arg}\,\textrm{min}_{\theta}\, E(\theta)$$ So with the trained parameters and sparse number of known solution field $$u$$, a detailed solution field can be created.

Subject:C++ Programming

TutorMe
Question:

Write a C++ program to print a pascal triangle. The number of rows to be printed will be given by the user as an integer input A pascal triangle looks like this. 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1

Inactive
Atul A.

Explanation: To write the next row of numbers- 1. The first number is 1 2. the next number is the sum of 1+5 =6 3. The next number is the sum of 5+10=15 ...and so on 4. The last number is 1 #include <iostream> using namespace std; int main() { int rows, coef = 1; cout << "Enter number of rows: "; cin >> rows; for(int i = 0; i < rows; i++) { for(int space = 1; space <= rows-i; space++) cout <<" "; // spaces at the left side for(int j = 0; j <= i; j++) { if (j == 0 || i == 0) coef = 1; else coef = coef*(i-j+1)/j; cout << coef << " "; } cout << endl; } return 0; } $$Brief Explanation$$ We declare a variable $$row$$ which stores the value of the number of rows entered by the user. $$coef$$ is the variable which is the number to be printed (In mathematics pascal triangle is used to find the coefficients of terms of a binomial expansion ) The outer loop runs from $$row$$ times and the second inner loop runs $$X$$ times, where x is the number of elements in that row. we run a small for loop to enter the spaces at the left side of the row. To print the initial and the last 1, we simply write if($$j == 0 || i == 0$$) {$$coef = 1$$; } To print other numbers of a row we use the formula $$coef=coef*(i-j+1) / j$$

Subject:Physics

TutorMe
Question:

Suppose you are stunt person who rides a motorcycle. You want to cross a 25m wide canal by flying over it on your motorcycle. You plan to use a plank at a particular angle to make your bike jump. You can leave the plank at a maximum speed of 90 km/h. What is the minimum angle at which you should place the plank so that you can cross the canal. ( Angle of plank cannot exceed 45 degrees)

Inactive
Atul A.

Applying the formula of the maximum range $$R$$ of a projectile: $$R= \frac{u^2sin(2x)}{g}$$ [I’m not deriving this formula] where $$u$$ is the velocity at which the motorcycle is launched, $$x$$ is the minimum angle of launch we put $$R=25m$$ and $$u= 90km/h = 25 ms^{-1}$$ as we need to find the minimum angle of the plank. Therefore, we get $$25=\frac{ (25^2) sin(2x) } {9.8}$$ or, $$sin(2x)=\frac{9.8} {25}$$ from this equation, we get the value of $$x$$ which is less than 45 degrees to be 11.54 degrees. Therefore, you should keep the plank at an angle of 11.54 degrees.

Contact tutor

Send a message explaining your
needs and Atul will reply soon.
Contact Atul